Repository navigation
fix(mobile): open page sheets above an already-open keyboard - #33760
Conversation
Moving focus into a sheet under an open keyboard sends no show event on the page. Fixes #32025
|
No actionable comments were generated in the recent review.
|
ELI5
On the phone, if you're typing in a terminal and double-tap the tab to rename it, the rename box used to open hidden behind the keyboard. Now it opens on top of the keyboard, where you can see it.
What Changed
MountedBottomDrawerseeds a sheet's keyboard lift from the current keyboard height when it opens. That seed only ran for fill sheets. On the over-the-air page, focus moves from the terminal input into the sheet's field without the keyboard moving, so no keyboard event follows and a content-sized sheet stayed at 0. The seed now also runs for every sheet on the page (Platform.OS === 'web'), where the keyboard height comes live from the shell.This covers every content-sized sheet that opens over an open keyboard on the page, not only Rename Terminal.
Why
Where the bug happens: the tab strip keeps the keyboard up through
useKeyboardPersistingTaps, which only does anything on the page. I checked each surface on emulators/simulators:keyboardWillShow.keyboardDidHidereaches JS. Seeding there would lift the sheet over a keyboard that is gone, so native content sheets keep skipping the seed. The original reason for skipping them also still holds:Keyboard.metrics()on iOS stays stale betweenwillHideanddidHide(fix(mobile): keep name input continuous during source picker transition #10145).I didn't build on #32027. It adds an opt-in
seedKeyboardprop set only byTextInputModal. That would also seed natively, which on Android lifts the sheet over a keyboard that has already gone, and it leaves other page sheets behind the keyboard. Fixing it at the drawer's existing seed gate is smaller and covers every page sheet.Linked Issue
Fixes #32025
Linear: STA-11744
Visual Proof
Android emulator, real over-the-air shell paired to a dev desktop serving the page. A terminal tab has the keyboard up, then I double-tap the tab.
Before (page build from main):
rename-sheet-before-android-page.webm
After (page build with this change):
rename-sheet-after-android-page.webm
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Page, Android emulator (OTA dev client against a hidden dev desktop): repro on main, fixed with this change (videos above).
Native iOS 27 simulator (dev client, real
TextInputModalin a temporary route): already lifts on main, unchanged.Native Android emulator: on main the IME hides when the sheet's Modal opens and the sheet sits at the bottom; unchanged by this PR.
Page, iOS simulator: the fixed build loaded, but synthetic double-taps never opened rename in the iOS WebView, so I couldn't capture that path.
mounted-bottom-drawer-page-keyboard.web.test.tsx: new case where a content-sized sheet opens while the shell already reports a keyboard. It fails without the change.mounted-bottom-drawer-keyboard-seam.test.tsxstill pins the native skip.All 49 drawer-related mobile test files pass.
check:code-quality:changedandcheck:react-doctor:changedare clean.AI Disclosure
Review
Agent skill upstream boundary
Notes
Mobile only, and the change is in the page bundle, which ships with the desktop. An older phone shell paired to a newer desktop gets the fix. Native screens are unchanged. Nothing touches SSH, desktop platforms or folder workspaces.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)