Skip to content

Commit 59c2054

Browse files
committed
🐛 Fix EndDatePicker selection range progress
Undo the PR #5503 as by default we preselect the selected date to other months also, as a result the linked PR will disturb the keyboard selection range
1 parent 6f0da37 commit 59c2054

File tree

2 files changed

+0
-30
lines changed

2 files changed

+0
-30
lines changed

src/day.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,6 @@ export default class Day extends Component<DayProps> {
312312
if (
313313
selectsEnd &&
314314
startDate &&
315-
!endDate &&
316315
(isAfter(selectingDate, startDate) || isEqual(selectingDate, startDate))
317316
) {
318317
return isDayInRange(day, startDate, selectingDate);

src/test/datepicker_test.test.tsx

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3153,35 +3153,6 @@ describe("DatePicker", () => {
31533153
).toBe(true);
31543154
}
31553155
});
3156-
3157-
it("should not apply '--in-selecting-range' class to the days till the date that matched selectedDate in the next months (endDatePicker)", () => {
3158-
const startDay = 3;
3159-
const endDay = 8;
3160-
const startDate = new Date(`2025/02/${startDay}`);
3161-
const endDate = new Date(`2025/02/${endDay}`);
3162-
3163-
const { container } = render(
3164-
<DatePicker
3165-
inline
3166-
selectsEnd
3167-
startDate={startDate}
3168-
endDate={endDate}
3169-
minDate={startDate}
3170-
/>,
3171-
);
3172-
3173-
goToNextMonth(container);
3174-
3175-
for (let i = 1; i <= endDay; i++) {
3176-
const inSelectionRangeDay = safeQuerySelector(
3177-
container,
3178-
`.react-datepicker__day--00${i}`,
3179-
);
3180-
expect(
3181-
inSelectionRangeDay.classList.contains(IN_RANGE_DAY_CLASS_NAME),
3182-
).toBe(false);
3183-
}
3184-
});
31853156
});
31863157

31873158
describe("selectsRange without inline", () => {

0 commit comments

Comments
 (0)