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

[DatePicker] Unexpected behavior when inserting an invalid date after a valid date #10124

Closed
2 tasks done
jati91hg opened this issue Aug 23, 2023 · 2 comments
Closed
2 tasks done
Labels
component: pickers This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information

Comments

@jati91hg
Copy link

jati91hg commented Aug 23, 2023

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Link to live example: https://codesandbox.io/s/inspiring-burnell-zrt2g3?file=/Demo.tsx

Steps:

  1. Insert a valid date in the correct format (e.g. 23.08.2023, german format: DD.MM.YYYY)). The provided date will stay visible even when you click outside of the date field.
  2. Insert an invalid date (23.8.2023, zero in month is missing) via copy & paste
  3. Now, when you click outside the datefield, the label will be shown. If you click on the date field itself again, the first valid date will be shown, but the valid date disappears again (and the label is shown) if you click anywhere outside of the field.

Current behavior 😯

(See Step 3) The previous date is shown, but doesn't stay fixed when you click anywhere outside the field. instead, the label is shown again

Expected behavior 🤔

In Step 3, I expected either

  1. When you click on the field again after providing an invalid date after a valid one and after that click anywhere outside of the field, the first provided valid date stays visible inside the field

OR

  1. When you click on the field again after providing an invalid date after a valid one, the format (TT.MM.JJJJ) will be shown as if you would insert a date for the first time

Context 🔦

No response

Your environment 🌎

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Order ID or Support key 💳 (optional)

No response

@jati91hg jati91hg added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 23, 2023
@zannager zannager added the component: pickers This is the name of the generic UI component, not the React module! label Aug 24, 2023
@flaviendelangle
Copy link
Member

Insert an invalid date (23.8.2023, zero in month is missing) via copy & paste

For this step, what are you focusing ?
The 1st section ? The last section ? All sections ?

If you could record a small video of your bug it would be great 👌

@flaviendelangle flaviendelangle added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Sep 1, 2023
@github-actions
Copy link

github-actions bot commented Sep 8, 2023

The issue has been inactive for 7 days and has been automatically closed. If you think that it has been incorrectly closed, please reopen it and provide missing information (if any) or continue the last discussion.

@github-actions github-actions bot closed this as completed Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pickers This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information
Projects
None yet
Development

No branches or pull requests

3 participants