Issue 3979 fix numberinput form validation #3984
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.
Fixes #3979 and #3982.
Based on #3756 I reworked the data flow handling to be more in line with other components again.
This means
onChange()
will be triggered on input again but still outputs validated and clamped data.I've also added a test for the expectation that
onChange()
andonBlur()
won't get called in the same run which might lead to theonBlur()
handler working with old data in case it's using data stored viauseState()
hook.Maybe that's something that should be added to all input components.
I also removed the
higherPrecision
handling introduced in #3756. For controlled components it allowed display values with higher precision than allowed. Like:would output
1.23
. However when changing the value manually afterwards it would fall back to the configured precision.Because this might be confusing I dropped this behaviour again. Sorry for that.
However if you find this useful I can revert this change.