-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
qburst/react-datepicker-3
#47Description
Describe the bug
--in-selecting-range class over the days in the DatePicker is applied wrongly.
To Reproduce
() => {
const [startDate, setStartDate] = useState(null);
const [endDate, setEndDate] = useState(null);
return (
<>
<DatePicker
selected={startDate}
onChange={(date) => setStartDate(date)}
selectsStart
startDate={startDate}
endDate={endDate}
/>
<DatePicker
selected={endDate}
onChange={(date) => setEndDate(date)}
selectsEnd
startDate={startDate}
endDate={endDate}
minDate={startDate}
/>
</>
);
};
- Select the Start Date in the Start Date Picker
- Select an End Date in the End Date Picker
- Navigate to the next month in the End Date Picker
- We can notice
--in-selecting-rangeclass highlight over all the days till the selected endDate
Expected behavior
--in-selecting-range class should be only applied when the endDate is not selected till the pre-selected-date.
Screenshots

If you notice in the above screenshot, we can see the --in-selecting-range class is getting applied over the wrong set of dates, eventhough I already selected the endDate.
Note: This issue is only there in the End Date Picker
Related Issue: #5490
Metadata
Metadata
Assignees
Labels
No labels