-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix(16865): fixes step operations in NumberInput #17048
fix(16865): fixes step operations in NumberInput #17048
Conversation
✅ Deploy Preview for v11-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Hey @guidari |
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.
LGTM!
Let's open a new issue for the the performance then!
3788b98
Hey there! v11.64.0 was just released that references this issue/PR. |
Closes #16865
This PR fixes the Inconsistent Increment/Decrement behavior in NumberInput Component when value and step are large
The usage of native
stepUp()
andstepDown()
methods is removedAdded test case to verify the behaviour when value and step are large
Changelog
stepUp()
andstepDown()
methods are removed and Increment/Decrement operations are handled inside our own functionI suspect that native
stepUp()
andstepDown()
methods can be unpredictable with large step values with large valuesWhen the current value (e.g., 1000) matches the step size (e.g., 1000), it seems like browsers treat it as a step boundary. and only increment by just 1 instead of the full step
Testing / Reviewing
Test NumberInput component with below props and any other combination: verify it works as expected