From ed5553595ab405327aac30f2c9c609b92f2fd472 Mon Sep 17 00:00:00 2001 From: "Ahmad K. Bawaneh" Date: Tue, 7 Jan 2025 14:21:03 +0300 Subject: [PATCH] fix #990 Number Boxes dont allow backspace --- .../main/java/org/dominokit/domino/ui/forms/NumberBox.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/domino-ui/src/main/java/org/dominokit/domino/ui/forms/NumberBox.java b/domino-ui/src/main/java/org/dominokit/domino/ui/forms/NumberBox.java index 129d79c2..d067c427 100644 --- a/domino-ui/src/main/java/org/dominokit/domino/ui/forms/NumberBox.java +++ b/domino-ui/src/main/java/org/dominokit/domino/ui/forms/NumberBox.java @@ -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) {