fix(nodes): focus the search field when revealed (#44)#47
Merged
Conversation
Tapping the Search icon in the Nodes/contact list toggled the search field into view but didn't focus it, so it took a second tap to start typing (reported on 1.2.91, Galaxy S25 Ultra / Android 16). Add a FocusRequester on the OutlinedTextField plus a LaunchedEffect that requests focus when the field appears — a single tap now reveals it, places the cursor, and raises the keyboard. The requester + effect live inside the `if (searchActive)` block so focus is re-requested on each reveal; requestFocus is wrapped in runCatching to swallow the "not attached yet" race on a fast recompose. The Messages-tab search field is always visible (not toggle-revealed), so it's unaffected. Fixes #44 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #44 — reported by @bergie on 1.2.91 (Galaxy S25 Ultra / Android 16).
Symptom (verified against the code, not just the report)
Tapping the Search icon in the Nodes / contact list reveals the search
OutlinedTextField(searchActivetoggle) but doesn't focus it, so ittakes a second tap to start typing.
NodesScreen.kthas noFocusRequesteranywhere, which is the cause. The Messages-tab searchfield is always visible (not toggle-revealed), so it's unaffected.
Fix
FocusRequesteron the field + aLaunchedEffectthat requests focuswhen the field appears (inside the
if (searchActive)block so itre-fires on each reveal;
requestFocuswrapped inrunCatchingfor thefast-recompose "not attached" race). One tap now reveals the field,
places the cursor, and raises the keyboard.
🤖 Generated with Claude Code