-
Notifications
You must be signed in to change notification settings - Fork 280
feat(ui5-step-input): add thousands separator & scrolling #12751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
🚀 Deployed on https://pr-12751--ui5-webcomponents-preview.netlify.app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
packages/main/src/StepInput.ts
Outdated
| } | ||
| } | ||
|
|
||
| _getValueOnkeyDown(e: KeyboardEvent) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is trying to implement multiple responsibilities.
We should separate cursor position tracking, extract string manipulation into a pure function, isolate validation logic from parsing, then delegate separator checks to a dedicated validate method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in c74eaf8
This PR introduces two new features to the ui5-step-input component: