Skip to content

fix(mobile): stop cold-launch keyboard flash on explore search#14395

Merged
dylanjeffers merged 1 commit into
mainfrom
fix/mobile-cold-launch-keyboard-flash
May 23, 2026
Merged

fix(mobile): stop cold-launch keyboard flash on explore search#14395
dylanjeffers merged 1 commit into
mainfrom
fix/mobile-cold-launch-keyboard-flash

Conversation

@dylanjeffers
Copy link
Copy Markdown
Contributor

Summary

  • Follow-up to apps#14289. That PR stopped the keyboard from re-appearing on background→foreground, but a brief keyboard flash still happened on app cold launch.
  • Root cause: the explore screen's useEffect calls .focus() whenever params?.autoFocus === true, regardless of whether the explore tab is the active tab. If the explore screen mounts off-screen with a stale autoFocus: true on its route, the focus call fires anyway and briefly summons the keyboard.
  • Fix: gate the focus call on useIsFocused() so the param is only consumed while the explore tab is actually the active tab. The intentional search-icon-tap flow still works — navigating to explore puts the tab in focus before the effect runs.

Test plan

  • Cold-start the app → no keyboard flash on initial load (regardless of which tab was last active before the kill)
  • Tap search icon from any tab header → explore opens with keyboard up and input focused
  • On explore, dismiss keyboard, switch to another tab, return to explore → keyboard does NOT reappear
  • On explore with keyboard up, background the app, return from background → keyboard does NOT reappear (still works after this change)
  • Tap search icon → keyboard reappears, dismiss it, tap search icon again → keyboard reappears (param re-trigger still works)

🤖 Generated with Claude Code

…launch keyboard flash

#14289 stopped the background→foreground flash but the cold-launch
flash remained: when the explore screen mounted off-screen with a
stale `autoFocus: true` route param, the useEffect would call
`.focus()` on the search input even though the explore tab wasn't
the active tab, briefly summoning the keyboard.

Gate the focus call on `useIsFocused()` so the param is only
consumed when the user is actually looking at the explore tab. The
intentional search-icon flow still works because navigating to
explore makes the tab focused before the effect runs.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 23, 2026

⚠️ No Changeset found

Latest commit: ad461e8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dylanjeffers dylanjeffers merged commit f950823 into main May 23, 2026
3 checks passed
@dylanjeffers dylanjeffers deleted the fix/mobile-cold-launch-keyboard-flash branch May 23, 2026 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant