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 Dec 19, 2024
1 parent 2c438e4 commit 07e015e
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,16 @@
import org.dominokit.domino.ui.events.EventType;
import org.dominokit.domino.ui.forms.validations.InputAutoValidator;
import org.dominokit.domino.ui.forms.validations.ValidationResult;
import org.dominokit.domino.ui.utils.*;
import org.dominokit.domino.ui.utils.ApplyFunction;
import org.dominokit.domino.ui.utils.DominoElement;
import org.dominokit.domino.ui.utils.HasMinMaxValue;
import org.dominokit.domino.ui.utils.HasPlaceHolder;
import org.dominokit.domino.ui.utils.HasPostfix;
import org.dominokit.domino.ui.utils.HasPrefix;
import org.dominokit.domino.ui.utils.HasStep;
import org.dominokit.domino.ui.utils.LazyChild;
import org.dominokit.domino.ui.utils.PostfixElement;
import org.dominokit.domino.ui.utils.PrefixElement;
import org.gwtproject.i18n.client.NumberFormat;
import org.gwtproject.i18n.shared.cldr.LocaleInfo;
import org.gwtproject.i18n.shared.cldr.NumberConstants;
Expand Down Expand Up @@ -211,7 +220,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();
}
}

/**
Expand Down

0 comments on commit 07e015e

Please sign in to comment.