diff --git a/islands/Chat.tsx b/islands/Chat.tsx index 0f4ab4d..dbc5e71 100644 --- a/islands/Chat.tsx +++ b/islands/Chat.tsx @@ -36,6 +36,7 @@ export default function Chat() { } else { setMessages((prev) => [...prev, data]); + // Auto-scroll to bottom on new message const chatBox = document.getElementById("chat-messages"); if (chatBox) { setTimeout(() => { @@ -73,19 +74,21 @@ export default function Chat() { }; return ( -
+
{isConnected ? `${userCount} online • Messages are not saved` : "Connecting..."}
{msg.text}
+{msg.text}