Add support for numeric pad

This commit is contained in:
Pierre HUBERT 2022-04-20 17:47:23 +02:00
parent 68cb630339
commit 1a1b31e8a0

View File

@ -56,7 +56,8 @@ function OTPInput() {
}
// Add new digit
else if (event.keyCode >= 48 && event.keyCode <= 57) {
else if ((event.keyCode >= 48 && event.keyCode <= 57)
|| (event.keyCode >= 96 && event.keyCode <= 105)){
inputs[i].value = event.key;
if (i !== inputs.length - 1)
inputs[i + 1].focus();