Skip to content

Conversation

@rodgobbi
Copy link
Collaborator

@rodgobbi rodgobbi commented Jun 29, 2025

Fix #2776

Description

The issue happens because the valid months of the calendar are calculated internally in the useCalendar hook when the layout of the day picker is a dropdown type, but other inner logic parts of the day picker use the startMonth and endMonth props as the calendar limits, which in this use case is undefined.

Changes

This PR unifies the source of truth for the start and end months of the day picker, using the navStart and navEnd returned by the getNavMonths in the useCalendar hook as the source of truth.
This also means that from now on, we should NOT use the startMonth and endMonth props directly, and instead use the navStart and navEnd values.

@rodgobbi rodgobbi requested a review from gpbl June 29, 2025 17:04
Copy link
Owner

@gpbl gpbl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done @rodgobbi, thanks!

@gpbl gpbl changed the title Fix: Setting a defaultMonth the next year when using the dropdown mode does not render the calendar fix: setting defaultMonth the next year when using the dropdown mode does not render the calendar Jun 29, 2025
@gpbl gpbl merged commit 46ff759 into gpbl:main Jun 29, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setting a defaultMonth the next year when using the dropdown mode does not render the calendar.

2 participants