suweya / react-verification-code-input

🎉A verification code input
https://suweya.github.io/react-verification-code-input/
148 stars 62 forks source link

Problems on iOS Safari/Cordova #9

Open flache opened 5 years ago

flache commented 5 years ago

Hi everyone, due to some iOS Safari restrictions around focusing HTMLInputElements, this module does not work on iOS Safari. Unfortunately, there is no easy fix, but it seems possible through swapping Elements and transferring values between Input Elements (So the focused input stays the same, but moves forward in the DOM tree)

In my case (I am using cordova), I was lucky since the UIWebview can be adapted, so if you are a cordova user, just set the KeyboardDisplayRequiresUserAction preference in the config.xml to false

dminkovsky commented 4 years ago

I just tested this on iOS 12 and it works fine. Guessing it works on iOS 13 too?

Not sure why this would be an issue, because the iOS restriction is that you can't focus an input element unless you're on a stack that was initiated due to user action. In this case, the user taps an input (that's a user action) and enters a number (that's another user input) so this library can focus the next input just fine?