Skip to content

NumberField doesn't allow deleting the first digit if it's immediately followed by a group separator #5927

Open
@illright

Description

Provide a general summary of the issue here

If you have a locale that has thousand separators for numbers, then enter a number like 1337, it will be formatted as 1,337 on blur. Then if you try to hit Backspace on 1, nothing will happen because ,337 is not a valid number

🤔 Expected Behavior?

It should allow erasing the 1 and strip the thousand separator itself

😯 Current Behavior

It doesn't allow erasing the 1, you have to move the cursor and erase the comma first

💁 Possible Solution

Strip the grouping separators automatically or have a way to have them always removed during editing

🔦 Context

No response

🖥️ Steps to Reproduce

The first live example in https://react-spectrum.adobe.com/react-aria/NumberField.html

Make sure you have a locale with thousand separators and place your cursor like this: 1|,024, then hit Backspace and watch nothing happen

Version

1.1.0

What browsers are you seeing the problem on?

Other

If other, please specify.

Brave

What operating system are you using?

Mac

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions