You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On the first calendar, set the month to December and the Year to 2025.
Expected behavior
The dropdown for the month January and dropdown for the year 2026 should be disabled, as this is out of range. The arrow is disabled correctly in this case, but the dropdowns are not.
Screenshots
Additional context
It's possible to fix this currently but it requires duplicating a lof the components and creating a custom Caption component. If we had access to the displayMonth prop inside of the Dropdown component it would make it possible to disable this, which would also be useful:
For example a custom Dropdown Component with our own data-disabled prop.
ZakisM
changed the title
Bug: Using numberOfMonths >= 2, the dropdowns should be disabled if after toYear
Bug: Using numberOfMonths >= 2, the dropdowns that are past the toDate should be disabled.
Jun 20, 2023
Hey, I think I tried this, however when you have multiple months an array is returned. How would I then know which index I need to use for the CustomDropdown?
Hey, I think I tried this, however when you have multiple months an array is returned. How would I then know which index I need to use for the CustomDropdown?
Ah I think this is the reason I chose to not disable these dropdowns. I think this issue doesn't really affect the usability of DayPicker. What's the actual problem when the dropdown are not disabled?
Ah I see, the issue is that when the dropdowns are not disabled, if I pick one of the months from the dropdown, the date picker is now showing dates that are outside of the fromDate/toDate I set:
Bug description
The dropdowns that are out of range should be disabled if they are after toDate.
To reproduce
https://codesandbox.io/s/react-daypicker-forked-ymyrvh
Steps
Expected behavior
The dropdown for the month January and dropdown for the year 2026 should be disabled, as this is out of range. The arrow is disabled correctly in this case, but the dropdowns are not.
Screenshots
Additional context
It's possible to fix this currently but it requires duplicating a lof the components and creating a custom
Caption
component. If we had access to thedisplayMonth
prop inside of theDropdown
component it would make it possible to disable this, which would also be useful:For example a custom Dropdown Component with our own
data-disabled
prop.The text was updated successfully, but these errors were encountered: