Commit f950823
fix(mobile): stop cold-launch keyboard flash on explore search (#14395)
## Summary
- Follow-up to
[apps#14289](#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](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>1 parent 57bf817 commit f950823
1 file changed
Lines changed: 9 additions & 3 deletions
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
62 | 68 | | |
63 | | - | |
| 69 | + | |
64 | 70 | | |
65 | 71 | | |
66 | 72 | | |
67 | 73 | | |
68 | | - | |
| 74 | + | |
69 | 75 | | |
70 | 76 | | |
71 | 77 | | |
| |||
0 commit comments