react-spectrum
react-spectrum copied to clipboard
NumberField should not allow spaces for percents or currencies that don't use spaces
Provide a general summary of the issue here
When using NumberField, some keypresses are blocked if they are not relevant. For example, you cannot enter letters. However, spaces are allowed. From my understanding, spaces only make sense when using unit since there will be a space between the number and the unit (and certain currencies), so they should probably be blocked in other cases.
๐ค Expected Behavior?
Spaces / spacebar presses should be blocked when the formal style does not allow spaces, such as unit and certain currencies like USD. That said, maybe spacebar presses shouldn't be allowed in any situation since the space is automatically inserted with the unit (or currency like EUR) without the user needed to do so themselves.
๐ฏ Current Behavior
Spaces can be entered into a NumberField
๐ Possible Solution
No response
๐ฆ Context
No response
๐ฅ๏ธ Steps to Reproduce
Using a NumberField with USD currency, press the spacebar to insert spaces.
Most weirdly is when you replace the input contents with only spaces, clicking outside the input replaces the text instead of just removing the spaces to make it blank.
Version
3.44.0
What browsers are you seeing the problem on?
Microsoft Edge
If other, please specify.
No response
What operating system are you using?
Windows
๐งข Your Company/Team
No response
๐ท Tracking Issue
No response