Skip to content

Commit

Permalink
fix: prevent year, month change error in showMonthAndYearPickers mode
Browse files Browse the repository at this point in the history
  • Loading branch information
KumJungMin committed May 27, 2024
1 parent a3bf209 commit 30e4f3c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/components/calendar/src/use-calendar-picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ export function useCalendarPicker(props: CalendarPickerProps) {

// scroll to the selected month/year when the component is mounted/opened/closed
useEffect(() => {
if (!isHeaderExpanded) return;

scrollTo(date.month, "months", false);
scrollTo(date.year, "years", false);
}, [isHeaderExpanded]);
Expand Down

0 comments on commit 30e4f3c

Please sign in to comment.