-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Provide a general summary of the issue here
When using roundingMode: 'floor'
in formatOptions
with a step
value in NumberField, the rounding mode is not respected when changing values.
🤔 Expected Behavior?
When roundingMode: 'floor'
is specified in formatOptions
, the value should be floored according to the specified fraction digits, regardless of whether a step
value is provided.
😯 Current Behavior
When a step
value is provided (e.g., step={0.01}
), the roundingMode: 'floor'
setting in formatOptions
is not respected when changing values. The value appears to use default rounding behavior instead of flooring.
💁 Possible Solution
The formatOptions
and NumberFieldProps
(like step
) shouldn't interfere with each other. I am aware there might be conflicting options that would be hard to solve, but ideally these two aspects of the component would work independently.
🔦 Context
No response
🖥️ Steps to Reproduce
- Start with the initial value of 1.236 in both fields
- Change the value in the first field (with step)
- Observe that the value doesn't respect the floor rounding mode
- Compare with the second field (without step) where the rounding mode is respected
CodeSandbox link: https://codesandbox.io/p/sandbox/sleepy-cori-3t8lcx
Version
react-aria-components@1.6.0
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
Windows 11
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response