feat(ui5-step-input): add thousands separator & scrolling#12751
Conversation
|
🧹 Preview deployment cleaned up: https://pr-12751--ui5-webcomponents.netlify.app |
There was a problem hiding this comment.
Now that we have thousands separator this sometimes causes the _isValueWithCorrectPrecision check to evaluate wrong.
The reason behind that is because we split the number into decilmals and whole numbers. So when we have 500,000 for example, it assumes that the three zeros behind are 'precision' numbers.
|
We also have a introduced a bug, where when we type a number, and then Submit (e.g. press Enter), if we then try to continue typing it is not working—it was working before. EDIT: Checked and it worked with different locale, so it might be something related to the comma separators mentioned in the above comment. |
| const delimiter = this.input?.value?.includes(".") ? "." : ","; | ||
| const numberParts = this.input?.value?.split(delimiter); | ||
| // @ts-ignore oFormatOptions is a private API of NumberFormat but we need it here to get the decimal separator | ||
| const delimiter = this.formatter?.oFormatOptions?.decimalSeparator || "."; |
There was a problem hiding this comment.
Usually the formatter is created either with format options passed as parameter or with the locale ones. In that case it will be with the locale ones so I would suggest taking the formatOptions and the decimal separator out of the locale data and not trough this private APi
| return; | ||
| } | ||
|
|
||
| const cursorPosition = this._getCursorPosition(); |
There was a problem hiding this comment.
maybe caretPosition?
|
🎉 This PR is included in version v2.19.0-rc.2 🎉 The release is available on v2.19.0-rc.2 Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version v2.19.0-rc.2 🎉 The release is available on v2.19.0-rc.2 Your semantic-release bot 📦🚀 |
This PR introduces two new features to the ui5-step-input component: