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

[fields] "Format" is still being used as MobileDatePicker input value, even after the dialog is closed #13679

Closed
ignatiusreza opened this issue Jun 30, 2024 · 2 comments · Fixed by #13688
Assignees
Labels
bug 🐛 Something doesn't work component: pickers This is the name of the generic UI component, not the React module! feature: Keyboard editing Related to the pickers keyboard edition mobile Targets mobile platform

Comments

@ignatiusreza
Copy link

ignatiusreza commented Jun 30, 2024

Steps to reproduce

Link to live example: https://codesandbox.io/s/sad-firefly-c5ptqr?file=/src/Demo.js

Steps:

  1. Click to open date picker dialog
  2. Select on today's date
  3. Click OK --> noticed that date picker value is updated correctly
  4. Click a 2nd time to open date picker dialog
  5. Click on "Clear" --> noticed that date picker value is mistakenly set to the string given as "format"

Current behavior

Date picker input "value" is set to "format".

Expected behavior

Date picker input "value" should be "null" (blank)

Alternatively, for MobileDatePicker (and MobileDateTimePicker), it might not be necessary for placeholder to be assigned as value when the input is focused. Since the expectation is for the user to pick the date (& time) via the date picker dialog.

Context

We customized the default date picker actionbar, to enable user to "Clear" current value of the datepicker.

Your environment

npx @mui/envinfo

Reproducible in code sandbox, browser: Chrome.

Search keywords: datepicker format placeholder

@ignatiusreza ignatiusreza added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jun 30, 2024
@LukasTy LukasTy self-assigned this Jul 1, 2024
@LukasTy
Copy link
Member

LukasTy commented Jul 1, 2024

@ignatiusreza Thank you for opening this issue.
The behavior indeed looks strange.
The different behavior of the readOnly flag, which is set on Mobile Pickers, causes this issue.

We'll look into this issue. 👍

@LukasTy LukasTy added bug 🐛 Something doesn't work component: pickers This is the name of the generic UI component, not the React module! mobile Targets mobile platform feature: Keyboard editing Related to the pickers keyboard edition and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jul 1, 2024
@LukasTy LukasTy changed the title "Format" is still being used as MobileDatePicker input value, even after the dialog is closed [fields] "Format" is still being used as MobileDatePicker input value, even after the dialog is closed Jul 1, 2024
Copy link

⚠️ This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

@ignatiusreza: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: pickers This is the name of the generic UI component, not the React module! feature: Keyboard editing Related to the pickers keyboard edition mobile Targets mobile platform
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants