react-otp-input icon indicating copy to clipboard operation
react-otp-input copied to clipboard

Autofocus first input when clear otp input

Open junghyeonsu opened this issue 5 years ago • 5 comments

I want autofocus first input when click clear buttton. because i use this library as password input.

image when click clear button...

image

i think shouldAutoFocus works same what i need. but i don't know how to autofocus when i clicked clear button. If it doesn't matter, can I take on this issue?

junghyeonsu avatar Dec 04 '20 11:12 junghyeonsu

Did u found any solution for this??....As i am creating an application, when the user enters invalid input, i am setting it to empty, but the autoFocus is staying at last box.

shivakrishna17 avatar Dec 15 '21 07:12 shivakrishna17

https://github.com/devfolioco/react-otp-input/issues/306#issuecomment-1160417780

You can use this snippet and implement a similar one, just change focusInput to 0 and it should work

blactrojan avatar Jun 20 '22 13:06 blactrojan

The feature is available in: https://www.npmjs.com/package/react18-input-otp

ritikbanger avatar Aug 09 '22 17:08 ritikbanger