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
When minDate/maxDate are set, the month dropdown in the calendar header lists and allows clicking months where all days are outside the allowed range. This is inconsistent with the navigation arrows, which correctly hide themselves when the adjacent month is fully out of range.
This inconsistency exposes a secondary bug: clicking a fully disabled month in the dropdown silently fails on the first click — the dropdown closes but the calendar remains on the current month. Only the second click navigates there.
This behavior only occurs on the first changeMonth() call after mount; subsequent calls work correctly.
To Reproduce
Render a DatePicker (see code below for exact props)
Open the month dropdown ("June ▾" in the header).
Observe that July, August, … December are listed and clickable, even though all of their days are beyond maxDate.
Click July.
The dropdown closes.
The calendar remains on June.
Click July again.
The calendar now navigates to July.
Reproduction
importDatePickerfrom"react-datepicker";import"react-datepicker/dist/react-datepicker.css";import{endOfDay,startOfDay}from"date-fns";import{useState}from"react";constminDate=startOfDay(newDate(2025,0,1));// Jan 1, 2025constmaxDate=endOfDay(newDate(2025,5,30));// Jun 30, 2025exportconstApp=()=>{const[range,setRange]=useState([newDate(2025,5,1),newDate(2025,5,15),]);return(<DatePickerselected={range[0]}startDate={range[0]}endDate={range[1]}onChange={setRange}minDate={minDate}maxDate={maxDate}showMonthDropdowndropdownMode="scroll"selectsRangeinline/>);}
Expected Behavior
The month dropdown should be consistent with the navigation arrows:
Months where all days fall outside minDate/maxDate should be hidden or disabled in the dropdown.
The same boundary logic used by the navigation arrows (Next button is hidden for future months with no selectable date) should apply to month selection.
If a fully disabled month is reachable via the dropdown, selecting it should navigate there on the first click.
Bug Description
When
minDate/maxDateare set, the month dropdown in the calendar header lists and allows clicking months where all days are outside the allowed range. This is inconsistent with the navigation arrows, which correctly hide themselves when the adjacent month is fully out of range.This inconsistency exposes a secondary bug: clicking a fully disabled month in the dropdown silently fails on the first click — the dropdown closes but the calendar remains on the current month. Only the second click navigates there.
This behavior only occurs on the first
changeMonth()call after mount; subsequent calls work correctly.To Reproduce
DatePicker(see code below for exact props)"June ▾"in the header).maxDate.Reproduction
Expected Behavior
The month dropdown should be consistent with the navigation arrows:
minDate/maxDateshould be hidden or disabled in the dropdown.Screenshots
Screen.Recording.2026-06-02.at.15.53.00.mov
Environment
react-datepickerversion: ^9.1.0