Open ponm-dnv opened 1 day ago
@ponm-dnv how would you expect this scenario to work? 🤔
The whole 2025 year is disabled from shouldDisableDate
, but to disable the year on YearCalendar
you should use shouldDisableYear
.
We are not calling shouldDisableDate
on month or year calendars for performance reasons, you can imagine that calling shouldDisableDate
~365 times does not sound performant. 🙈
Steps to reproduce
Steps:
Current behavior
Notice that the date is not what you selected - reverts to September 2022, or the last year that you've viewed with non-disabled dates
Expected behavior
The calendar should stay on the month/year that you selected
Context
This only happens when selecting a date within a large range of disabled dates, e.g. selecting Sept 2025 when all of 2025 is disabled. Adding one non-disabled date in 2025 solves it for that year, but the problem continues for other years in the future.
Your environment
``` Don't forget to mention which browser you used. Output from `npx @mui/envinfo` goes here. ```npx @mui/envinfo
Search keywords: shouldDisableDate, monthCalendar