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] disableOpenPicker prop not working on MobileDatePicker #8036

Open
2 tasks done
julianCast opened this issue Feb 24, 2023 · 3 comments
Open
2 tasks done

[pickers] disableOpenPicker prop not working on MobileDatePicker #8036

julianCast opened this issue Feb 24, 2023 · 3 comments
Labels
component: pickers This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature

Comments

@julianCast
Copy link

julianCast commented Feb 24, 2023

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Link to live example on v5: https://codesandbox.io/s/heuristic-solomon-mxsrc0?file=/demo.tsx
Link to live example on v6: https://codesandbox.io/s/distracted-tom-6m02r8?file=/demo.tsx

I used the example of your documentation, adding the disableOpenPicker to the three different date pickers. Only MobileDatePicker will still be able to be opened.

Current behavior 😯

MobileDatePicker ignores the disableOpenPicker and it's opened with interaction.

Expected behavior 🤔

MobileDatePicker should not open the picker after disableOpenPicker is used.

Context 🔦

No response

Your environment 🌎

This is my environment but, as I said, it's happening in your documentation example.

npx @mui/envinfo
 System:
    OS: macOS 13.0.1
  Binaries:
    Node: 16.17.1 - ~/.nvm/versions/node/v16.17.1/bin/node
    Yarn: 3.3.0 - ~/.nvm/versions/node/v16.17.1/bin/yarn
    npm: 8.15.0 - ~/.nvm/versions/node/v16.17.1/bin/npm
  Browsers:
    Chrome: 110.0.5481.100
    Edge: 110.0.1587.41
    Firefox: 108.0.1
    Safari: 16.1
  npmPackages:
    @emotion/react: ^11.10.5 => 11.10.5
    @emotion/styled: ^11.10.5 => 11.10.5
    @mui/base:  5.0.0-alpha.117
    @mui/core-downloads-tracker:  5.11.8
    @mui/lab: ^5.0.0-alpha.119 => 5.0.0-alpha.119
    @mui/material: ^5.11.8 => 5.11.8
    @mui/private-theming:  5.11.7
    @mui/styled-engine:  5.11.8
    @mui/system:  5.11.8
    @mui/types:  7.2.3
    @mui/utils:  5.11.7
    @mui/x-date-pickers: ^5.0.15 => 5.0.15
    @types/react: ^17.0.39 => 17.0.39
    react: 17.0.2 => 17.0.2
    react-dom: 17.0.2 => 17.0.2
    typescript: ^4.9.4 => 4.9.4

Order ID 💳 (optional)

No response

@julianCast julianCast added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Feb 24, 2023
@LukasTy
Copy link
Member

LukasTy commented Feb 24, 2023

API documents this prop and mentions that it controls the rendering of the open picker button.
Is there a use case you @julianCast are trying to achieve and this behavior is stopping you from doing it?
IMO we should be making some sort of a change in this regard. Either:

  • change the description and also not open view on mobile when it is toggled on;
  • remove this prop from available options on Mobile picker versions;

What's your take @flaviendelangle?

@LukasTy LukasTy added component: pickers This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 24, 2023
@LukasTy LukasTy changed the title disableOpenPicker not working on MobileDatePicker [pickers] disableOpenPicker prop not working on MobileDatePicker Feb 24, 2023
@julianCast
Copy link
Author

Oh I misunderstood the meaning of it. I was trying to disable the opening. I think the first option would make sense :

change the description and also not open view on mobile when it is toggled on;

Thank you for the clarification!

@LukasTy
Copy link
Member

LukasTy commented May 2, 2023

Oh I misunderstood the meaning of it. I was trying to disable the opening. I think the first option would make sense :

After discussing and investigating this issue further, it's clear that simply disabling the mobile picker opening would sort of make no sense, because that is the only behavior that is currently supported by the mobile picker versions.

This change should be done together with or after #7869.

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! enhancement This is not a bug, nor a new feature
Projects
None yet
Development

No branches or pull requests

2 participants