[Android] `onBlur` closes the keyboard but doesn't remove focus on input
See original GitHub issueDescribe the bug
On v0.1.5
’s CardField
, when executing the imperative onBlur
method on Android it closes the keyboard successfully, but focus moves to the card number input.
The same behaviour also applies when clicking anywhere on the parent component. Keyboard closes, but focus moves to the card number input.
It works perfectly for iOS
To Reproduce Steps to reproduce the behavior:
- Use CardField component.
- Provide all card details
- Execute the imperative
onBlur
method. - Keyboard closes but focus moves to the card number input.
Expected behavior When keyboard closes, no other input should be focused.
Screenshots
https://user-images.githubusercontent.com/8103420/125928646-5e464535-201c-49a8-a055-343ebae1eed3.mov
Smartphone (please complete the following information):
- Device: Android Pixel 3 emulator
- OS: Android 11
Also happens on physical device/
- Device: Samsung S10+
- OS: Android 11
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (2 by maintainers)
Top Results From Across the Web
Unfocus a TextInput in React Native - Stack Overflow
A better way is to use ScrollView and Keyboard.dismiss. By using ScrollView when the user taps outside of textInput, keyboard dismissed.
Read more >492894 - input does not lose focus and "blur" event ... - Monorail
- The virtual keyboard disappears. What is the expected behavior? The input does should lose focus and the "blur" event should be raised....
Read more >Element: focus event - Web APIs | MDN
The focus event fires when an element has received focus. The event does not bubble, but the related focusin event that follows does...
Read more >How to Dismiss the Keyboard in Flutter the Right Way
To trigger the keyboard to dismiss itself, we need to remove “focus” from our text field. By removing the current focus from the...
Read more >TextInput - React Native
Two methods exposed via the native element are .focus() and .blur() that will focus or blur the TextInput programmatically.
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 Free
Top 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
@kperdomo1 this is gonna be fixed in the next release (0.1.6) @lucasroca your issue same
it’s already fixed in
0.2.0v