Unexpected behavior when editing value ending in zero in NumericTextBox

1 Answer 36 Views
Input NumericTextBox
Chap
Top achievements
Rank 1
Chap asked on 06 May 2024, 03:24 PM

If a `NumericTextBox` contains a value ending in `0` and the user edits the value by backspacing over the non-zero digits the next number entered replaces the zero instead of inserting before it.

For example, the starting value is:

`220`

The user clicks to place their cursor as so:

`22|0`

If they then hit backspace twice, the cursor will jump to after the zero:

`0|`

And when a new digit is entered it replaces the zero:

`3|`

I would expect the user to be able to enter new digits to appear before the zero rather than replacing it. This behavior is reproducible on the example on the Overview page in the documentation.

Is there any way to disable this behavior?

1 Answer, 1 is accepted

Sort by
0
Wissam
Telerik team
answered on 08 May 2024, 12:05 PM

Hello, Chap,

I have to say that this is currently not possible with the current implementation, as numbers starting with 0 are not considered valid numbers in the component.

I tried with setting a format using the different available formats from kendo-intl, handling the component in controlled mode using the onChange and value props, setting the value as a string, and setting the value to the `ref.current.element.value`, but they all result in unexpected behaviour.

Therefore, I would suggest submitting a feature request for adding an option or format that allows entering 0 as an initial value:

If you find it move convenient, I can submit one on your behalf.

Please let me know if you have any further questions on this matter.

Regards,
Wissam
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources!

Tags
Input NumericTextBox
Asked by
Chap
Top achievements
Rank 1
Answers by
Wissam
Telerik team
Share this question
or