adobe / react-spectrum

A collection of libraries and tools that help you build adaptive, accessible, and robust user experiences.
https://react-spectrum.adobe.com
Apache License 2.0
12.16k stars 1.06k forks source link

Quick double space hit on Number input adds '. ' to the field #6667

Open wellguimaraes opened 4 days ago

wellguimaraes commented 4 days ago

Provide a general summary of the issue here

https://react-spectrum.adobe.com/react-aria/NumberField.html

Try quickly hitting space twice on a number field and it'll add . to the field.

Does it even make sense to allow space char?

๐Ÿค” Expected Behavior?

Nothing

๐Ÿ˜ฏ Current Behavior

. is added to the field value.

๐Ÿ’ Possible Solution

Don't know yet.

๐Ÿ”ฆ Context

No response

๐Ÿ–ฅ๏ธ Steps to Reproduce

https://react-spectrum.adobe.com/react-aria/NumberField.html

Try quickly hitting space twice on a number field and it'll add . to the field.

Version

latest

What browsers are you seeing the problem on?

Chrome, Microsoft Edge, Safari, Other

If other, please specify.

Arc (any Chromium based)

What operating system are you using?

Mac OS 14.5

๐Ÿงข Your Company/Team

No response

๐Ÿ•ท Tracking Issue

No response

wellguimaraes commented 4 days ago

It's related to this config on MacOS:

image

But I think it should be somehow prevented for NumberFields.

snowystinger commented 4 days ago

Some locales use space for group separators, so we can't ignore it. And periods are used for both group and decimal depending on the locale.

I'm not sure there is anything we can do about it since it's an OS level thing, not browser.