Input type="Number": typing decimal separator causes value to disappear
See original GitHub issueHi,
There’s an issue in the Input
control when its type is Number
. When trying to type a decimal number, only a comma (,) can be used as the decimal separator. When trying to use a dot (.), the input’s text is emptied. This can be confusing to the user, as he/she doesn’t know that only the comma separator is accepted. Here is a small sample where you can test the behaviour of the control.
To fix this problem, I think the dot separator should be accepted. Then, when the user focus out of the control (or anything else that could trigger the change
event), the input’s value could be formatted to use a comma separator instead of a dot separator. Or the dot separator could also be left in the input’s value…
Furthermore, after typing a decimal number (for example, 3,14), if the user presses the up (or the down) arrow, the value is incremented (or decremented) to the next integer (for example, 3). I think that it should increment (or decrement) the value by 1. So, for example, if the user types 3,14 and then press the down arrow, the value should become 2,14 instead of 3. Or, even better, a property could be added to specify how much the value should be incremented (or decremented).
Do you think all of this would make sense?
Thanks! Mathieu
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
Hello @mathlizee
Yes I think so, after a quick research in the net, it seems like locale specific.
From the 3 issues, 1 left about the empty value and it will be tracked in a new issue: https://github.com/SAP/ui5-webcomponents/issues/1675