DEV Community

Build OTP Input Field in React — No Package Needed

Stephen Gbolagade on January 13, 2024

A lot of products are incorporating the idea of One-Time Password (or simply OTP) over sending users a link for them to click so they can be verifi...
Collapse
 
bisoladev profile image
Bisola Onaolapo

Awesome! Thank you

Collapse
 
ifeanyi_nworji profile image
Ifeanyi Nworji

you didn't handle a user deleting the number with shift key backwards or delete key forward and also you did not handle clipboard paste. The clipboard paste has a difficult handling approach in firefox because it is expected that the input is type of number or tel and not text for good user experience. Maybe you can improve the code.