-
Notifications
You must be signed in to change notification settings - Fork 1.3k
NumberField fixes #1509
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
NumberField fixes #1509
Conversation
…o numberfield-fixes
Build successful! 🎉 |
Build successful! 🎉 |
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.
Generally I like the direction of the changes.
I think there's still a subtle difference between native and this
try pressing up arrow on <input type="number" min="-5" step="3"/>
, it starts at 1
so I think the extra rule is
When the min is less than zero, start the increment from 0 but advance to the next valid step with min as our starting point.
Here's the fiddle I used to check them all, two of each line so I could easily hit both up and down without reloading https://jsfiddle.net/snowystinger/4ctejfLd/14/
The other one I cannot figure out is <input type="number" min="-5" step="3"/>
which starts at -6 if you hit increment, but starts at -5 if you decrement.
Thanks, missed it in the description
That said, I don't know how important it is?
Yes. See the PR description. These were intentional deviations. |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
moved the styles so they are more specific than the isQuiet padding right styles
…ectrum into numberfield-fixes
Build successful! 🎉 |
For browsers that don't support input events level 2
…ectrum-v3 into numberfield-fixes
Build successful! 🎉 |
e.g. latin decimal point in arabic
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
…hen with minus sign (#1517)
Build successful! 🎉 |
Build successful! 🎉 |
Closes #1486
step
prop to match slider, and native number input behavior more closelyaria-roledescription
textStep behavior details
minValue={2}
andstep={3}
, the steps would be 2, 5, 8, etc.step={3}
, valid values would be -6, -3, 0, 3, 6, etc.<input type="number">
behavior, which seems to always try to start from zero even if zero is out of range.<input type="number">
behavior, which seems to always try to start from zero even if zero is out of range.0
. This is an intentional deviation from native<input type="number">
behavior, which starts from zero but also increments/decrements, so really starts at 1 or -1.