tttstudios / react-native-otp-input

Tiny Javascript library which provides an elegant UI for user to input one time passcode.
MIT License
521 stars 238 forks source link

How to restrict the user from entering ,.- in keyboardtype=number-pad in android? #183

Open deepnrng opened 2 years ago

deepnrng commented 2 years ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

arjun-oodle commented 2 years ago

I tried to use code={otp} property and setting the otp field only when it's a valid input. I was able to prevent/clear the user from providing incorrect character. But cursor moved to next field anyway.

This is a very buggy library. Better to create your own or just fork this repo and customise it.