Skip to content

[Bug]: Number fields separator not locale aware #6013

@RuxG

Description

@RuxG

Code of conduct

  • I agree to follow this project's code of conduct.

Impacted component(s)

NumberField

Library version

spectrum-web-components 1.9.0

Expected behavior

Users from different regions of the globe should be able to separate the values in the number fields with the appropriate separator for their language.
Example: In English the formatting would be "123,456.789", while for other locales the formatting would be "123.456,789".

This is a problem because, for example, in Adobe Express, we display numeric keyboards and the separator will be chosen by the OS according to the user's localization settings.
But if the user has a region like Romania, the separator shown will be "," , which will not be accepted by the NumberField. Therefore, the user will not be able to enter decimal values.

Actual behavior

The "," always separates thousands and "." is the separator for decimals, regardless of user language.
How can we reproduce:

https://opensource.adobe.com/spectrum-web-components/storybook/?path=/story/number-field--default

In this storybook, use different locale settings and observe that adding a comma will always separate thousands, not the fractional part.

Screenshots

No response

What browsers are you seeing the problem in?

No response

How can we reproduce this issue?

  1. Go to '...'
  2. Click on '....'
  3. Scroll to '....'
  4. Check console
  5. See error

Sample code or abstract reproduction which illustrates the problem

No response

Severity

None

Logs taken while reproducing problem

No response

Would you like to track this issue in Jira?

  • Yes, please tell me the ticket number!

Metadata

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