user
06/06/2021, 12:52 PMmysterious-toddler-20573
06/06/2021, 1:04 PMsalmon-xylophone-28580
06/06/2021, 6:53 PMpowerful-evening-99811
06/06/2021, 6:57 PMminiature-printer-24569
06/06/2021, 7:17 PMpowerful-evening-99811
06/06/2021, 7:24 PMminiature-printer-24569
06/06/2021, 7:31 PMminiature-printer-24569
06/06/2021, 7:36 PMsalmon-xylophone-28580
06/06/2021, 9:04 PMminiature-printer-24569
06/06/2021, 10:08 PMsalmon-xylophone-28580
06/07/2021, 7:01 AMlittle-greece-16394
06/07/2021, 8:29 AM#chat_room div. Any idea on how to clear the input box too? If I replace the input box it looses focus, it would be nice to be able to post several messages in a row without having to click the box again...most-jelly-15242
06/07/2021, 12:13 PMblue-manchester-57655
06/07/2021, 12:33 PMmysterious-toddler-20573
06/07/2021, 12:53 PMlittle-greece-16394
06/07/2021, 1:52 PMid="chat_message" to itmost-jelly-15242
06/07/2021, 1:53 PMlittle-greece-16394
06/07/2021, 1:54 PMinput using HTMX? I'm not clear if that is actually supported...little-greece-16394
06/07/2021, 1:55 PMmysterious-toddler-20573
06/07/2021, 1:57 PMmysterious-toddler-20573
06/07/2021, 1:58 PMmysterious-toddler-20573
06/07/2021, 1:58 PMlittle-greece-16394
06/07/2021, 1:59 PM<div hx-ws="connect:/chatroom">
<div id="chat_room"></div>
<form hx-ws="send">
<input id="chat_message" type="text" name="chat_message">
</form>
</div>
And this is the response on the websocket:
<input id="chat_message" hx-swap-oob="innerHTML">
<div id="chat_room" hx-swap-oob="beforeend">
<div>
<span class="user">{{user}}</span>
<span class="message">{{message}}</span>
</div>
</div>little-greece-16394
06/07/2021, 1:59 PM<input...> there does nothinglittle-greece-16394
06/07/2021, 2:03 PM<form hx-ws="send" _="on submit put '' into #chat_message.value">
<input id="chat_message" type="text" name="chat_message">
</form>little-greece-16394
06/07/2021, 2:05 PM.value is a bit special since it's not really an HTML element? There's a shadow element in the DOM for the value, but I don't know how to modify itmost-jelly-15242
06/07/2021, 2:29 PMlittle-greece-16394
06/07/2021, 2:49 PMmost-jelly-15242
06/07/2021, 2:52 PMmost-jelly-15242
06/07/2021, 2:54 PM<input id="chat_message" type="text" name="chat_message" value="">
<div id="chat_room" hx-swap-oob="beforeend">
<div>
<span class="user">{{user}}</span>
<span class="message">{{message}}</span>
</div>
</div>