Skip to content
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

DateTimeInput or DateInput reinitialise when typing a date starting with '0' - only on Firefox #9330

Closed
guilbill opened this issue Oct 4, 2023 · 1 comment · Fixed by #9543
Labels

Comments

@guilbill
Copy link
Contributor

guilbill commented Oct 4, 2023

Note: Only noticed on firefox.

What you were expecting:

I have a DateTimeInput field with a date 10/01/1985 10:20:
image

I select the field and type "01". The date is now 01/01/1985 10:20

What happened instead:

The field is reinitialized as soon as I type the '0'
image

Steps to reproduce:

Go to https://react-admin-storybook.vercel.app/?path=/story/ra-ui-materialui-input-datetimeinput--basic
Type a valid date.
Now focus the beginning of the field, and type '0' (as if you want to type '01' for exemple)

Related code:

The basic stackblitz is enough to reproduce.
https://stackblitz.com/github/marmelab/react-admin/tree/master/examples/simple
On firefox : Edit a Post > Miscellanous > Edit a date input by starting by a '0'

<DateTimeInput source='foo'/>

Other information:

I first though of a behaviour of the html input on firefox. But trying it directly :
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local
I did not reproduce the same behaviour.

Environment

  • React-admin version: "4.13.2"
  • React version: "18.2.0"
  • Browser: Firefox 118.0.1 (64 bits)
@slax57
Copy link
Contributor

slax57 commented Oct 5, 2023

Reproduced, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants