TextInput doesn't lose focus after dismissing keyboard on some Android devices
See original GitHub issueDescription
Current Behavior
When TextInput is focused and keyboard is shown, pressing hardware back button dismisses the keyboard but doesnt’t blur the TextInput. Pressing on the TextInput again doesn’t trigger the keyboard.
I noticed it happening on these devices: Mobistart V1 (android v 9), Meizu M3s (android v 5.1), Honor 8 (android v 7). This behaviour doesn’t seem to be dependant on Android version or brand. Also this behaviour appears in every React Native app.
Expected Behavior
The TextInput should lose focus after hardware back button press.
Version
0.65.1
Output of npx react-native info
No warnings or errors apper in console.
Steps to reproduce
Basically it happens with any TextInput.
<TextInput />
Snack, code example, screenshot, or link to a repository
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:10
Top Results From Across the Web
RN TextInput not lose it's focus and hide it's keyboad when ...
Scroll view dismiss the focus when click outside function without any extra things. Share.
Read more >How to Dismiss the Keyboard in Flutter the Right Way
Step 2: Dismiss the Keyboard. To trigger the keyboard to dismiss itself, we need to remove “focus” from our text field. By removing...
Read more >Handle input method visibility | Android Developers
When input focus moves in or out of an editable text field, Android shows or hides the input method—such as the on-screen keyboard—as ......
Read more >Today's React Native Tip: Keyboard issues in ScrollView
Fix: keyboardShouldPersistTaps · 'never' (the default), tapping outside of the focused text input when the keyboard is up dismisses the keyboard. When this ......
Read more >How to open or dismiss the keyboard in Flutter - LogRocket Blog
If you create something similar to the above screen, you must remember that it will push the widget upward when the keyboard opens,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I managed to work around by adding a ref to the text input and a keyboard listener to blur the text input when the keyboard hide. Here is the logic:
This is still an issue on react native v0.69.6, unsure if fixed in .7