forge
forge copied to clipboard
[calendar] calendar gets stuck in an infinite loop when `disabledDateBuilder` disables all future or past dates
Describe the bug:
When the calendar's next or previous month button is clicked and all dates in the relevant direction are disabled via the disabledDateBuilder
callback, the calendar will not render the requested month. Instead it endlessly goes through months, running the callback on each date and freezing the page.
To Reproduce: Steps to reproduce the behavior:
- Create a Forge calendar instance with all dates after the current month disabled via
disabledDateBuilder
- Click the next month button
Expected behavior: The calendar should render a new month even if no dates within the month are enabled. Navigation between disabled date may need to be allowed.
Please complete the following information:
- Forge version: 2.23.0
- I have searched existing issues before creating this report? Y
- Browser: All
- Platform: All
- OS: All
Additional context:
The ideal solution as discussed is to enable focus and navigation on disabled dates. Attempting to go to the next or previous month should always result in the next or previous month rendering instead of the month with the closest enabled date. Setting min
or max
should still disabled navigation past the min or max date as it currently does.