otp_input: Fix OtpInput to stop_propagation on keydown. (#249)
This commit is contained in:
parent
90c5125abc
commit
97e61a507b
1 changed files with 6 additions and 0 deletions
|
|
@ -113,6 +113,9 @@ impl OtpInput {
|
||||||
let ix = ix - 1;
|
let ix = ix - 1;
|
||||||
chars.remove(ix);
|
chars.remove(ix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cx.prevent_default();
|
||||||
|
cx.stop_propagation();
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
let c = key.chars().next().unwrap();
|
let c = key.chars().next().unwrap();
|
||||||
|
|
@ -124,6 +127,9 @@ impl OtpInput {
|
||||||
}
|
}
|
||||||
|
|
||||||
chars.push(c);
|
chars.push(c);
|
||||||
|
|
||||||
|
cx.prevent_default();
|
||||||
|
cx.stop_propagation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue