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

Title: Restrict focus to first empty input field #398

Open
nasim67reja opened this issue May 18, 2023 · 1 comment
Open

Title: Restrict focus to first empty input field #398

nasim67reja opened this issue May 18, 2023 · 1 comment

Comments

@nasim67reja
Copy link

  • Describe the Feature Request

Hello,

I have been using the react-otp-input package and I have found an issue with the way the focus is handled. Currently, if I click on the third or fourth input field and enter a value, the value is entered in the first input field and the focus moves to the next input field which ones i have clicked for example four if i clicked one three. This behavior is not intuitive and can be confusing for users.

I would like to request a feature where the focus is restricted to the first empty input field. This means that if a user clicks on any input field, the focus should automatically move to the first empty input field. This will ensure that users can only enter values sequentially and will prevent any confusion.

Thank you for considering this feature request. I look forward to hearing your thoughts on this.

Best regards,
Nasim

  • Describe Preferred Solution
@RemyMachado
Copy link

I second this, but I would ask for some more. I think it would make sense to allow for users to navigate to any empty field. What doesn't make sense is the bug which fills the wrong input.

It would be great if we had an option to choose between the two:

  • restrict to first empty input (as issue's author stated @nasim67reja)
  • navigate to any empty inputs, but handling the values correctly (instead of the current bug)

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