question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android] `onBlur` closes the keyboard but doesn't remove focus on input

See original GitHub issue

Describe 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:

  1. Use CardField component.
  2. Provide all card details
  3. Execute the imperative onBlur method.
  4. 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:closed
  • Created 2 years ago
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
arekkubaczkowskicommented, Jul 29, 2021

@kperdomo1 this is gonna be fixed in the next release (0.1.6) @lucasroca your issue same

1reaction
arekkubaczkowskicommented, Aug 11, 2021

it’s already fixed in 0.2.0v

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found