summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-08-28 08:34:41 +0200
committerChristophe Besson <cbesson@gmail.com>2026-08-28 08:34:41 +0200
commit3c2316dea098c3e99ef40c0012b83f0e8b735c10 (patch)
treea9c79c554ceb4de5e09bccc94fab25ca34924a34 /packages
parent25ebaed11772056c611c3ce650387d6961e0baa0 (diff)
parent45cbe43a21a9d046afebb248b4bd455bf0fd9cd0 (diff)
downloadmeshbay-3c2316dea098c3e99ef40c0012b83f0e8b735c10.tar.gz
Merge branch 'fix/chat-input-focus'
Diffstat (limited to 'packages')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/chat-app.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/chat-app.js b/packages/meshbay-hub/src/meshbay_hub/static/chat-app.js
index 3d518b3..f21ec2c 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/chat-app.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/chat-app.js
@@ -316,6 +316,16 @@ function ChatPanel({ transportRef, username, entries, gekRef, onRefreshIndex,
return () => ro.disconnect();
}, [messages]);
+ // Entering the Chat tab should leave the cursor in the composer, ready to
+ // type — the panel mounts fresh on every tab switch, so a mount effect is
+ // the tab-entry hook. `preventScroll` because the layout effects above are
+ // still settling the panel height and a focus-driven scroll would fight
+ // them; on a phone this also means the keyboard opens without the view
+ // jumping.
+ useEffect(() => {
+ inputRef.current?.focus({ preventScroll: true });
+ }, []);
+
// The panel was `calc(100vh - 220px)`: a guess at how much sits above it. On a
// phone the group header — title, description, edit link, delete button, tabs
// — is closer to 430px, so the panel ran past the fold and the composer ended