Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connecting a hardware keyboard on iOS causes loss of focus #186

Open
CriusNyx opened this issue Jun 7, 2022 · 1 comment
Open

Connecting a hardware keyboard on iOS causes loss of focus #186

CriusNyx opened this issue Jun 7, 2022 · 1 comment

Comments

@CriusNyx
Copy link

CriusNyx commented Jun 7, 2022

Describe the bug
When a hardware keyboard is connected to an iOS device it causes the component to loose focus on selection

To Reproduce
Steps to reproduce the behavior:

  1. On an iOS device or iOS simulator connect a hardware keyboard.
  2. Select an OTP input
  3. The component looses focus after a few milliseconds.

Expected behavior
Component does not loose focus

Smartphone (please complete the following information):

  • Device: iPad simulator 9th gen
  • OS: 15.5
  • React Version: 16.13.1
  • RN Version: 0.63.4

Additional context
I identified the cause of this message and have a proposed fix.
The behavior happens because the software keyboard appears for 0 milliseconds, and then gets hidden by the hardware keyboard.
This triggers the handleKeyboardDidHide event handler in the index.tsx file
If you add a check to ensure that the event duration on that event handler was longer then 0 milliseconds that will fix the issue.

@zoobibackups
Copy link

same issue. I have disable hardware keyboard option in the simulator and now its working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants