-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to apply under decimal started by 0 with <NumberInput />
on mobile devices
#8593
Comments
Reproduced, thanks! |
Okay, so I took some time to dig into this, but the issue is way more bushy than I anticipated. Root of the issue:
We need to sync these states both ways:
This is the root of the issue, because when the user types in Why is it different on mobile
What's blocking me from fixing the issue
So basically I'm out of ideas about how to solve this issue. 🙁 If anyone can help us finding a solution for this one, we'd be grateful! 🙏 |
I suggest we add a test in the |
What you were expecting:
I would like to submit value
0.001
with<NumberInput />
.On PC, It works with comma not point such as
0,001
, but it doesn't work on mobile device especiallyIOS
.(I tested with iPhone13 pro, Safari and Chrome)
As a workaround I found, is to override the
format
prop as(value) => value
.What happened instead:
The value on the input sets to
0
Steps to reproduce:
Code sandbox : https://codesandbox.io/s/lucid-fast-8b9lxg?file=/src/posts/PostCreate.tsx
PC
0.0**
to the<NumberInput />
on the page.Mobile (
IOS
,android
partially)0.0**
or0.0**
to the<NumberInput />
on the page.Related code:
<NumberInput />
react-admin/packages/ra-ui-materialui/src/input/NumberInput.tsx
Line 25 in d75f2c7
convertNumberToString
function:react-admin/packages/ra-ui-materialui/src/input/NumberInput.tsx
Lines 176 to 177 in d75f2c7
Other information:
For this function, I assume
0.0.toString()
case should be considered as well, because this function can be executed during typing numberEnvironment
The text was updated successfully, but these errors were encountered: