Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(datePicker): prevent year, month change in showMonthAndYearPickers mode #3088

Merged
merged 7 commits into from
Jul 8, 2024
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(() => {
jrgarciadev marked this conversation as resolved.
Show resolved Hide resolved
if (!isHeaderExpanded) return;

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