-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomersrsp:NumberField
Description
Provide a general summary of the issue here
NumberField decrease/increase buttons are not decreasing/increasing value as expected when step is small due to JS transforming step into exponential notation.
🤔 Expected Behavior?
Even when step is small, decrease/increase should work.
😯 Current Behavior
After clicking a couple of times on increase/decrease button, value gets stuck and doesn't increase/decrease anymore.
💁 Possible Solution
Change implementation of roundToStepPrecision function to support exponential notation of numbers.
https://github.com/adobe/react-spectrum/blob/main/packages/%40react-stately/utils/src/number.ts#L24
🔦 Context
console.log(0.0000001) // 1e-7
console.log(0.000001) // 0.000001
🖥️ Steps to Reproduce
Click on the increase or decrease button multiple times. Notice how at some point it's not possible to increase/decrease anymore.
Version
3.42
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
MacOS
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomersrsp:NumberField