react-spectrum icon indicating copy to clipboard operation
react-spectrum copied to clipboard

NumberField - Can't enter decimal values with maximumSignificantFigures set.

Open aidan-keay opened this issue 5 years ago โ€ข 3 comments

๐Ÿ› Bug Report

Using formatOptions, set maximumSignificantDigits to 4 for example.

๐Ÿค” Expected Behavior

The user should be allowed to enter decimal values.

๐Ÿ˜ฏ Current Behavior

The user is not allowed to enter decimal values.

๐Ÿ’ Possible Solution

๐Ÿ”ฆ Context

๐Ÿ’ป Code Sample

https://codesandbox.io/s/festive-taussig-uwv3t?file=/src/App.tsx

๐ŸŒ Your Environment

๐Ÿงข Your Company/Team

๐Ÿ•ท Tracking Issue (optional)

aidan-keay avatar Sep 29 '21 13:09 aidan-keay

That looks like a bug. And it looks like we significant digits in our tests https://github.com/adobe/react-spectrum/blob/main/packages/%40react-spectrum/numberfield/test/NumberField.test.js I think it's probably addressed in https://github.com/adobe/react-spectrum/pull/2075 which I'd like to get in, but it needs a little more work before it can go in https://github.com/adobe/react-spectrum/pull/2075#discussion_r668350262

snowystinger avatar Sep 29 '21 16:09 snowystinger

Perhaps we can pull some stuff out of #2075 to expedite a fix for this issue.

LFDanLu avatar Nov 03 '21 18:11 LFDanLu

Fixed by https://github.com/adobe/react-spectrum/pull/5156

LFDanLu avatar Jun 18 '25 17:06 LFDanLu