fix: critical flaw in InputNumber.concatValues() #18071
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There have been some long-standing issues with InputNumber for nearly four years. I finally tracked it down to some flawed logic in concatValues.
To Reproduce
Navigate to the Prefix and Suffix section of the InputNumber docs and enter a 4-digit number in the "Mile" field. The insertion point jumps past the suffix.
This should resolve quite a few issues that don't necessarily seem related. At a minimum, it has been causing caret positioning issues when decimal places or suffixes are enabled. I will try to search for and tag as many related issues as I can. There are also some issues that were marked fixed that were not, so I'll tag those too.
This fix should also be pushed to v17 and v18 branches.
Open Issues
Fixes #16189
Fixes #16297
Fixes #16496
Fixes #17869
Fixes #17073
Erroneously closed issues
Fixes #9272
Fixes #10582
Fixes #14227