telerik / kendo-react

Issue tracker - KendoReact http://www.telerik.com/kendo-react-ui/
https://kendo-react-teal.vercel.app
Other
212 stars 37 forks source link

[Bug][NumericTextBox] Pressing character keys clears parts of the entered number #2528

Open kdikov82 opened 13 hours ago

kdikov82 commented 13 hours ago

I'm submitting a...

Current behavior

Pressing any character on the keyboard will clear part of the entered number, based on the cursor position.

Expected behavior

Pressing non-numeric characters should not affect the value in the NumericTextBox

Minimal reproduction of the problem with instructions

1) Open the example https://stackblitz.com/edit/react-4qxkt4?file=app%2Fapp.jsx 2) Place the cursor before the decimal separator (or before any digit different than 0) in the NumericTextBox and press any character key ('a' for example) 3) All values after the cursor position will be cleared.

Package versions: 8.3.0

kdikov82 commented 13 hours ago

Temporary workaround is to stop the propagation of the keydown event conditionally: https://stackblitz.com/edit/react-3zbode-h9h7jm?file=app%2Fmain.tsx