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

[pickers] using disableOpenPicker prop with responsive DatePicker shows no dates in mobile calendar dialog #11618

Closed
samanthaksanders opened this issue Jan 9, 2024 · 2 comments · Fixed by #13212
Assignees
Labels
bug 🐛 Something doesn't work component: DatePicker The React component. component: pickers This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process. regression A bug, but worse

Comments

@samanthaksanders
Copy link

samanthaksanders commented Jan 9, 2024

Steps to reproduce

Link to live example: https://codesandbox.io/s/amazing-silence-ks3gq6?file=/src/Demo.tsx

Steps:

  1. Use device toolbar to simulate mobile device (or alternately, look at the link on a device)
  2. Click the input field to trigger the picker dialog
  3. The dialog contains no days to select, only action buttons
Screenshot 2023-11-22 at 11 24 09 am

Current behavior

When using <DatePicker disableOpenPicker /> on a device, I want to select a date from the calendar picker but there are no dates in the dialog to choose. The dialog only contains action buttons.

Expected behavior

When using <DatePicker disableOpenPicker /> on a device I want to select a date from the calendar picker. There should always be a list of days/months/years to select, as well as action buttons.

Context

We want to be able to use the disableOpenPicker prop which should only effect the desktop version. Happy with the different behaviour on mobile, and know that disableOpenPicker won't do anything in that context. But it would be good if there were still some dates to pick 😄

We are now using the DesktopDatePicker only instead, but would be good to be able to use the responsive version and the disableOpenPicker prop.

Your environment

npx @mui/envinfo
Issue is replicated in MUI codesandbox link using DatePicker, and simply adding disableOpenPicker

System:
    OS: macOS 13.3.1
Browser
   Chrome: 119.0.6045.159

Search keywords: pickers disableOpenPicker

@samanthaksanders samanthaksanders added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jan 9, 2024
@zannager zannager added the component: pickers This is the name of the generic UI component, not the React module! label Jan 9, 2024
@michelengelen michelengelen added bug 🐛 Something doesn't work component: DatePicker The React component. and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 9, 2024
@michelengelen
Copy link
Member

Thanks @samanthaksanders for raising this issue.
I did add this to the board for the team to assess the issue and estimate it, but for the meantime you could do a workaround with a device detection like this:
example with basic device detection

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.

@samanthaksanders: 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: DatePicker The React component. component: pickers This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process. regression A bug, but worse
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants