otp_input: Fix OtpInput to stop_propagation on keydown. (#249)

This commit is contained in:
Jason Lee 2024-09-17 10:55:09 +08:00 committed by GitHub
parent 90c5125abc
commit 97e61a507b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -113,6 +113,9 @@ impl OtpInput {
let ix = ix - 1;
chars.remove(ix);
}
cx.prevent_default();
cx.stop_propagation();
}
_ => {
let c = key.chars().next().unwrap();
@ -124,6 +127,9 @@ impl OtpInput {
}
chars.push(c);
cx.prevent_default();
cx.stop_propagation();
}
}