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] Year overflow broken #7495

Closed
DylanSimowitz opened this issue May 22, 2016 · 6 comments · Fixed by mui/material-ui#4381
Closed

[DatePicker] Year overflow broken #7495

DylanSimowitz opened this issue May 22, 2016 · 6 comments · Fixed by mui/material-ui#4381
Labels
bug 🐛 Something doesn't work component: pickers This is the name of the generic UI component, not the React module!

Comments

@DylanSimowitz
Copy link

Problem description

I noticed in the docs that the datepicker should go 100 years backwards and 100 years forwards by default, however in the docs and in any datepicker I make it only goes to 2013. I found the issue to be justify-content: center. This centers the flex item vertically because the flex-direction is column. For some reason overflow doesn't take into account the height before the center point of the flex item. Setting the flex-direction to row (default value) fixes this issue and I can see all the way to 1916. Unfortunately this breaks positioning of datepicker ranges that do not overflow. They are no longer vertically centered. Setting align-items: center to center non-overflowed ranges will subsequently break our original fix of overflowed ranges for the same reason that justify-content breaks it in the current implementation.

TL;DR: Flexbox centering and overflow don't work nicely.

Steps to reproduce

Look at the Simple example in the docs.

Versions

  • Material-UI: 15
  • React: 15
  • Browser: Chrome/Firefox

Images & references

@nathanmarks nathanmarks added the bug 🐛 Something doesn't work label May 22, 2016
@DylanSimowitz
Copy link
Author

DylanSimowitz commented May 22, 2016

mui/material-ui#4321 This fixes the overflow while maintaining vertical alignment.

@lostpebble
Copy link

This is a major issue. As it stands now, the Date Picker is basically unusable if you want to work with dates ranging more than a few years (picking a birthday etc.). Luckily I noticed it before deploying my new version and patched it as per the pull request, others might not be so lucky.

@DylanSimowitz
Copy link
Author

@lostpebble Not sure if you used my PR, but mui/material-ui#4344 provides a better fix.

@lostpebble
Copy link

@ToxicSalt Yep, that was the one I used, thanks. Works perfectly now.

@robertleeplummerjr
Copy link

Has this been released yet? It looks as though it is in a state of limbo.

@robertleeplummerjr
Copy link

nm, it is in 0.15.2, testing now. Good work fellas!

@oliviertassinari oliviertassinari added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 21, 2022
@zannager zannager added 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 Jan 12, 2023
@zannager zannager transferred this issue from mui/material-ui Jan 12, 2023
@oliviertassinari oliviertassinari added the bug 🐛 Something doesn't work label Jan 12, 2023
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!
Projects
None yet
8 participants