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] Disabled month is selected by default #6121

Closed
wscourge opened this issue Jul 17, 2019 · 2 comments
Closed

[pickers] Disabled month is selected by default #6121

wscourge opened this issue Jul 17, 2019 · 2 comments
Labels
component: pickers This is the name of the generic UI component, not the React module! duplicate This issue or pull request already exists

Comments

@wscourge
Copy link

wscourge commented Jul 17, 2019

Steps to reproduce

It is important to understand, that at the time of writing it's July 2019.

  1. Create picker with:
maxDate={moment().add(6, 'months')
views={['year', 'month']}
openTo="year"
  1. Open the picker and select next year
  2. Selected month is July, althought it is disabled

Expected behavior

No month should be selected - guess that's going to be hard, as it is not valid date due to moment deprecation warning.

An acceptable solution would be to set the selected month to anything that is not disabled.

Actual behavior

Selected month is one of the disabled months.

Live example

https://codesandbox.io/s/basicdatepicker-material-demo-forked-5czq6?file=/demo.tsx

Due to better active month visibility, I'm attaching the screenshot of my custom date picker as well:

image

Your Environment 🌎

Tech Version
@material-ui/lab v5.0.0-alpha.16
@oliviertassinari oliviertassinari changed the title Disabled month is selected by default [DatePicker] Disabled month is selected by default Nov 14, 2020
@oliviertassinari
Copy link
Member

I think that we could at least display the months that are out of range disabled.

@oliviertassinari oliviertassinari transferred this issue from mui/material-ui-pickers Nov 14, 2020
@oliviertassinari oliviertassinari added the bug 🐛 Something doesn't work label Nov 14, 2020
@ZeeshanTamboli ZeeshanTamboli transferred this issue from mui/material-ui Sep 12, 2022
@ZeeshanTamboli ZeeshanTamboli added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed bug 🐛 Something doesn't work labels Sep 12, 2022
@flaviendelangle
Copy link
Member

flaviendelangle commented Sep 12, 2022

Fixed by #4814

@flaviendelangle flaviendelangle added duplicate This issue or pull request already exists component: pickers This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Sep 12, 2022
@flaviendelangle flaviendelangle changed the title [DatePicker] Disabled month is selected by default [pickers] Disabled month is selected by default Sep 12, 2022
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! duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants