devfolioco / react-otp-input

:heavy_check_mark: OTP Input Component for React
http://devfolioco.github.io/react-otp-input
MIT License
657 stars 427 forks source link

Add blur #331

Closed mking-keeper closed 2 years ago

mking-keeper commented 2 years ago

Add ability to blur otp input

This is needed for mobile. When the user enters an incorrect code on ios, if the keyboard is popped up, the snackbar is hidden. so we add the ability to blur (which will hide the keyboard) so we can make sure the snackbar is visible.

Example added to the demo code:

This shows what happens when the blur helper is called.

Screen Shot 2022-02-03 at 4 02 02 PM Screen Shot 2022-02-03 at 4 02 06 PM