Revert "fix(verify-account-ui): Cannot read property 'focus' of undefined"

This reverts commit cb45acb2e2.
pull/43/head
yolo 5 years ago
parent cb45acb2e2
commit d24b8bd9cf

@ -1,5 +1,4 @@
const codes = document.querySelectorAll('.code')
const length = codes.length
codes[0].focus()
@ -7,14 +6,8 @@ codes.forEach((code, idx) => {
code.addEventListener('keydown', (e) => {
if(e.key >= 0 && e.key <=9) {
codes[idx].value = ''
if (length - 1 == idx) {
return
}
setTimeout(() => codes[idx + 1].focus(), 10)
} else if(e.key === 'Backspace') {
if (idx == 0) {
return
}
setTimeout(() => codes[idx - 1].focus(), 10)
}
})

Loading…
Cancel
Save