Skip to content

Commit 6b3fb85

Browse files
committed
issue 132: focus selection range when having value
1 parent 0b63036 commit 6b3fb85

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/DateRangePicker/index.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,11 +350,13 @@ function DateRangePicker(props) {
350350
// - set the active range's background to transparent color
351351
// to prevent the calendar auto focusing on the day of today by default when no
352352
// start date nor end date are set.
353-
// - does not set the end date of the selection range as default when mouse is out.
353+
// - does not set focus on the empty selection range when mouse leaves.
354354
// ---
355355

356356
// setActiveDate(null);
357-
// setFocusedRange([0, focusedRange[1]]);
357+
if (range.startDate || range.endDate) {
358+
setFocusedRange([0, focusedRange[1]]);
359+
}
358360
return;
359361
}
360362

0 commit comments

Comments
 (0)