Skip to content

Comments

fix: re-focus message input after sending#110

Open
alexmdac wants to merge 2 commits intoboldsoftware:mainfrom
alexmdac:main
Open

fix: re-focus message input after sending#110
alexmdac wants to merge 2 commits intoboldsoftware:mainfrom
alexmdac:main

Conversation

@alexmdac
Copy link

When submitting a message, setSubmitting(true) disables the
textarea, which causes the browser to drop focus. After submission
completes, a useEffect restores focus, but only if the user hasn't
deliberately moved focus elsewhere (checked via
document.activeElement === document.body).

Skipped on mobile to avoid popping up the soft keyboard unexpectedly.

@cla-bot
Copy link

cla-bot bot commented Feb 18, 2026

We require contributors to sign our Contributor License Agreement, and we don't have you on file. In order for us to review and merge your code, please contact @crawshaw at david@bold.dev to get yourself added.

When submitting a message, setSubmitting(true) disables the textarea,
which causes the browser to drop focus. After submission completes,
a useEffect restores focus — but only if the user hasn't deliberately
moved focus elsewhere (checked via document.activeElement === document.body).

Skipped on mobile to avoid popping up the soft keyboard unexpectedly.

Co-authored-by: Shelley <shelley@exe.dev>
@cla-bot
Copy link

cla-bot bot commented Feb 18, 2026

We require contributors to sign our Contributor License Agreement, and we don't have you on file. In order for us to review and merge your code, please contact @crawshaw at david@bold.dev to get yourself added.

@cla-bot cla-bot bot added the cla-signed label Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant