react-day-picker icon indicating copy to clipboard operation
react-day-picker copied to clipboard

Bug: Using min breaks range selection with keyboard

Open staaky opened this issue 2 years ago • 0 comments

Bug description

Using min breaks keyboard selection after selecting the first date of a range.

This seems to be caused by the initial date of the range ending up disabled after hitting Enter.

Along that same line, if you use disabled instead of min and the date you've just selected ends up disabled, it also breaks keyboard selection.

To reproduce

https://codesandbox.io/s/react-daypicker-forked-3kd7lr?file=/src/App.tsx

Steps

  1. Press Tab to get to a date.
  2. Press Enter to select the first date of the range.
  3. Try to use the arrow keys to get to a second date.

Expected behavior

After hitting Enter on the first Date, which then becomes disabled, the selection should jump to the next selectable date and you should be able to use arrow keys to complete selection of the range.

If you are using disabled instead of min and it ends up disabling the day you've just selected with Enter, you would expect this same behavior where the active selection is moved to the next selectable date.

staaky avatar Nov 07 '23 23:11 staaky