Open oreqizer opened 10 months ago
The team discussed this today and we think that perhaps we could change our number parsing so that we try using the user's locale and the locale specified by I18nProvider. We figured that a user would be used to typing the number separator they are used to and that they may not even know what separator would be correct for other locales any ways. That way your repro steps would work by converting the ,
to a .
as the user types.
Updating with some links and extra info about an implementation. We already do a check/test for the numbering system being used, we could do something similar for the group/decimal separator and perform two attempts at parsing to figure out what the number is. See https://github.com/adobe/react-spectrum/blob/main/packages/%40internationalized/number/src/NumberParser.ts#L71 for guesses at the numbering system.
I just realized we might need to make this conditional to only mobile keyboards though? If the keyboard has both , and . it could be ambiguous.
The team discussed this today and we think that perhaps we could change our number parsing so that we try using the user's locale and the locale specified by I18nProvider. We figured that a user would be used to typing the number separator they are used to and that they may not even know what separator would be correct for other locales any ways. That way your repro steps would work by converting the
,
to a.
as the user types.
I think this is predictable behavior
Are there any updates on this issue?
Provide a general summary of the issue here
Regardless of what is set in
I18nProvider
,NumberField
always opens iPhone numeric keyboard with,
instead of.
if the iPhone region is set to such that they use that decimal separator.This makes it impossible to input in decimals.
๐ค Expected Behavior?
Honestly, don't know. I've read about iPhone numeric keyboards and apparently there's no way to change which numeric keyboard is going to be displayed.
Ideally, the keyboard would open with locale identical to the provided to
I18nProvider
, or it would be possible to changeNumberField
locale so that it corresponds to iPhone's regional settings.๐ฏ Current Behavior
Currently, for
sk-SK
regional settings in iPhone anden-GB
inI18nProvider
, the iPhone numeric keyboard opens with,
instead of.
as the decimal separator.๐ Possible Solution
input[type='number']
. slightly worse UX, but much better than being unable to input in decimalsI18nProvider
locale with iPhone regional settings๐ฆ Context
I am trying to open up numeric keyboard on iPhone with the correct, functioning decimal separator.
๐ฅ๏ธ Steps to Reproduce
Slovak
region13,37
. it will erase the,
, because it expects.
Version
react-aria-components@1.0.1
What browsers are you seeing the problem on?
Safari
If other, please specify.
No response
What operating system are you using?
iOS 17
๐งข Your Company/Team
No response
๐ท Tracking Issue
No response