fix(mobile): dismiss Android keyboard when TextInput unmounts - #869
Open
adrienzheng-cb wants to merge 1 commit into
Open
fix(mobile): dismiss Android keyboard when TextInput unmounts#869adrienzheng-cb wants to merge 1 commit into
adrienzheng-cb wants to merge 1 commit into
Conversation
Collaborator
🟡 Heimdall Review Status
🟡
|
| Code Owner | Status | Calculation | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ui-systems-eng-team |
🟡
0/1
|
Denominator calculation
|
React Native leaves the Android soft keyboard open when a focused TextInput unmounts (iOS dismisses it automatically), stranding the keyboard on screen. Add an Android-guarded unmount cleanup effect that calls Keyboard.dismiss() when the field was focused at unmount. Refs CDS-2620 Co-authored-by: Cursor <cursoragent@cursor.com>
adrienzheng-cb
force-pushed
the
adrienzheng/cds-2620-dismiss-android-keyboard-when-textinput-unmounts
branch
from
September 1, 2026 16:32
ca4f623 to
734eb71
Compare
Contributor
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.
What changed? Why?
Mobile
TextInputnow dismisses the Android soft keyboard when it unmounts while focused. An Android-guarded unmount cleanup effect callsKeyboard.dismiss()if the field was focused at unmount time. AfocusedRefmirrors the latest focus state so the cleanup can read it without re-subscribing on every focus change. Includes 3 focused tests.Root cause (required for bugfixes)
React Native does not dismiss the Android soft keyboard when a focused
TextInputunmounts, unlike iOS which dismisses it automatically. This left the keyboard stranded on screen after the input was removed (e.g. navigating away or conditionally unmounting the field).Testing
How has it been tested?
Testing instructions
Focus a mobile
TextInputon Android, then unmount it (e.g. navigate away or toggle it off) — the keyboard should dismiss. On iOS the behavior is unchanged. See the 3 added tests inpackages/mobile/src/controls/__tests__/TextInput.test.tsx.Linear: https://linear.app/coinbase/issue/CDS-2620
Change management
type=routine
risk=low
impact=sev5
automerge=false
Made with Cursor