-
Notifications
You must be signed in to change notification settings - Fork 278
Closed
Labels
Milestone
Description
Issue
The input value disappears in Input type="Number"
when the user types decimal number separators: the user can type a single "dot" in the input field, but if the user type a second one, the value disappears. (Also it turns out this is locale specific, for other locales this happens on typing "comma").
Root cause: this happens because the native input fires an event with empty value and we sync our value to empty. This can be observed with pure HTML input, however the user input remains:
<input id='myInput' type="number">
myInput.addEventListener("input", (e) => {
// if we have already typed "1." and type a second ".",
// the "input" event is fired and the "e.target.value" would be a empty string
console.lof(e.target.value);
});To reproduce
Steps to reproduce the behavior:
- Go to https://sap.github.io/ui5-webcomponents/master/playground/main/pages/Input/
- Find input type="Number" example at the bottom
- Type "1", after that start typing "." (dots) and you will see that on the second dot, the value disappears
Expected behavior
The user input should remain as with the native input element
Context
- UI5 Web Components version 1.0.0-rc.7
- OS/Platform: {...} macOS
- Browser (if relevant): {...} Chrome
Affected components ui5-input
Reactions are currently unavailable