Skip to content

fix(nodes): focus the search field when revealed (#44)#47

Merged
thatSFguy merged 2 commits into
masterfrom
fix-nodes-search-focus
Jun 28, 2026
Merged

fix(nodes): focus the search field when revealed (#44)#47
thatSFguy merged 2 commits into
masterfrom
fix-nodes-search-focus

Conversation

@thatSFguy

Copy link
Copy Markdown
Owner

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 (searchActive toggle) but doesn't focus it, so it
takes a second tap to start typing. NodesScreen.kt has no
FocusRequester anywhere, which is the cause. The Messages-tab search
field is always visible (not toggle-revealed), so it's unaffected.

Fix

FocusRequester on the field + a LaunchedEffect that requests focus
when the field appears (inside the if (searchActive) block so it
re-fires on each reveal; requestFocus wrapped in runCatching for the
fast-recompose "not attached" race). One tap now reveals the field,
places the cursor, and raises the keyboard.

🤖 Generated with Claude Code

thatSFguy and others added 2 commits June 28, 2026 07:59
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>
@thatSFguy
thatSFguy merged commit 3f2ed37 into master Jun 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Contact list: clicking Search doesn't focus the search field

1 participant