mirror of
https://github.com/nestriness/nestri.git
synced 2026-11-20 14:09:50 +02:00
The boxes were one input each, with script moving focus between them. That worked in a clean browser and failed in an ordinary one: on the emailed code, whose first box is marked as a one-time-code field, typing and pasting did nothing, while the device code, which is not marked, worked. A password manager or autofill prompt hooking that field and a script moving focus between six fields were working against each other. It also left gaps: pasting into the third box with the second one empty produced a code with a character missing. Now the real input is stretched invisibly over the boxes and is the only thing typed into, pasted into or autofilled; the boxes only display what it holds, with the next one ringed and showing a caret. With nothing moving focus there is nothing to fight, and a code cannot have a gap. The browser's own validation message works again too, since the field it points at is where the boxes are.