-
Environment
If possible, link to a minimal repro (fork this code sandbox): https://codesandbox.io/s/mutable-frog-kw5m3 Actual behavior9.95 is rounded to 10 when min of 0 is set Expected behaviorno rounding should occur because 9.95 > 0 |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
What happens when you click the buttons though? And is it what you expected? When you set the It seems like you should be adjusting your step size if you want to supply a value like 9.95. If you expect some other behavior, let me know... |
Beta Was this translation helpful? Give feedback.
-
Looking a little more closely... I can see it's a little confusing how we derive the value precision from the step size... but do you have any proposals for an alternative? for example, in your original code example, do you expect users to be selecting values as follows: 9.95, 10.95, 11.95, .... ? |
Beta Was this translation helpful? Give feedback.
-
@adidahiya I wouldn't want there to be any rounding initially. Basically I have a form which is getting initialized from data and I would want the user to see the exact values coming in. I am not sure why this component would do any rounding on that initial render. Is there some way to get around that? |
Beta Was this translation helpful? Give feedback.
-
Yes, I get that, and the current behavior is surprising from a developer perspective... but still think there's potential for confusion after the initial render in your proposed use case because rounding will occur after the user clicks increment/decrement. You can work around this by setting the step size props, like |
Beta Was this translation helpful? Give feedback.
Yes, I get that, and the current behavior is surprising from a developer perspective... but still think there's potential for confusion after the initial render in your proposed use case because rounding will occur after the user clicks increment/decrement.
You can work around this by setting the step size props, like
minorStepSize={0.05}