An accessibility friendly OTP UI with some validation.
For now the correct OTP is "123456".
User can paste OTP directly also, using keyboard or paste button provided, from the clipboard. (Currently working on Chrome, Edge, Brave, not on Firefox. And I haven't tested on Safari.)
TEST CASES USED:
Focus shifts with every single digit pressed.
Focus goes backward when a digit is deleted.
Checks only positive numbers.
Each input takes only single digit.
Checks 123456 as the correct OTP.
User gets only 3 attempts to enter correct OTP, otherwise page refreshes.
The Verify button remains disabled till all input fields are filled.