-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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] The Popper position modification makes it impossible to select the year if this one is smaller than the months #9288
Comments
For better context, I want to add that whenever there's more space below the picker input and the month calendar opens below the input, I don't get this issue. See the video. In the video, there's a footer. That's the workaround I guess: "There should be enough space below the input so that both calendars can open below it and we can avoid the unwanted behavior I recorded above". Screen.Recording.2023-06-11.at.04.07.21.mov |
Effectively, I can reproduce the bug here: https://codesandbox.io/s/hungry-matan-gmqrmn?file=/demo.tsx To reproduce it, the space under the field must be:
I think it's because the Poppper placement is computed before the end of the transition. And when mouse down occurs it refers the placement computation which leads to the glitch. For quick fixes, you can override the behavior with
It could be by disabling the to flip, or modifying the year calendar size, or any other thing that match with you UI. For the propper fix of the bug It will require a bit more investigation |
Seems that it's due to some delay to remove fading elements. The simplest quick fix might be to use |
Yeah, I'd done this already. Thanks |
Just thought, I did not mention, that another option to solve the issue could be to use |
Duplicates
Latest version
Steps to reproduce 🕹
Link to live example:
MUI.DatePicker.Issue.Wth.Popper.Positioning.mov
Steps:
minDate
prop value to January 1, 2018 (sub 5 years from 2023. Hard set the month and date to Jan and 1st, respectively)maxDate
prop value to December 31, 2020 (sub 3 years from 2023. Hard set the month and date to Dec and 31st, respectively)view
prop value to['month', 'year']
Current behavior 😯
Expected behavior 🤔
The year calendar view should stay in place and not move its position. I suspect the change in position is because the content (number of available years) is small, hence it's readjusting to its default position.
Well, I'm able to assume this because, without the minDate and maxDate restrictions, the year calendar view continues to stay at the top of the Datepicker input after selecting a month. I only get this glitch whenever a boundary date duration of less than 10 years is set.
Context 🔦
This issue only happens on desktop, obviously.
Your environment 🌎
npx @mui/envinfo
Order ID or Support key 💳 (optional)
No response
The text was updated successfully, but these errors were encountered: