Skip to content

Commit

Permalink
fix #990 Number Boxes dont allow backspace
Browse files Browse the repository at this point in the history
  • Loading branch information
vegegoku committed Jan 7, 2025
1 parent 00e7eaf commit ed55535
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ protected String createKeyMatch() {

protected void onKeyDown(Event event) {
KeyboardEvent keyboardEvent = Js.uncheckedCast(event);
if (!keyboardEvent.key.matches(createKeyMatch())) event.preventDefault();
if (keyboardEvent.key.length() == 1 && !keyboardEvent.key.matches(createKeyMatch())) {
event.preventDefault();
}
}

protected void onPaste(Event event) {
Expand Down

0 comments on commit ed55535

Please sign in to comment.