react-datepicker icon indicating copy to clipboard operation
react-datepicker copied to clipboard

keyboard-selected is applied incorrectly.

Open kibasaur opened this issue 10 months ago • 3 comments

Describe the bug The class .react-datepicker__day--keyboard-selected is applied to a selected day, regardless of month. This makes it so that all days gets the class .react-datepicker__day--in-selecting-range.

To Reproduce Steps to reproduce the behavior:

  1. Go to Datepicker examples
  2. Find the first or any Date Range example
  3. Select a range of say a week in the current month.
  4. Go back or forward one or several months

Expected behavior Days that are not supposed to be highlighted (days outside of the range) will be highlighted. if March 13th is selected, then if you start hovering around any other month, the 13th that month will have the css class .react-datepicker__day--keyboard-selected, making all of the days between have the in-selecting-range class that enables the highlight

Screenshots

Image Image Image

Desktop (please complete the following information):

  • Browser Mozilla Firefox

  • Device: Thinkpad laptop

  • OS: Windows 11

kibasaur avatar Mar 13 '25 15:03 kibasaur

Observing the same issue. Here are some screenshots if it helps showing the .react-datepicker__day--keyboard-selected class is applied to the same day every month:

Image Image

gillesbouvier-qz avatar Mar 13 '25 20:03 gillesbouvier-qz

I'll work on this issue.

@kibasaur, I think we're setting the react-datepicker__day--keyboard-selected as the same date in the months regardless of the selected month which will help user to remember the date they selected. It's also helping us to start the keyboard navigation from the same date on any month. It'll just pre-select that selected date for all months.

balajis-qb avatar Mar 15 '25 14:03 balajis-qb

I fixed the issue, will raise a PR by tomorrow

balajis-qb avatar Mar 16 '25 10:03 balajis-qb

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 10 days.

github-actions[bot] avatar Sep 13 '25 02:09 github-actions[bot]

This issue was closed because it has been stalled for 10 days with no activity.

github-actions[bot] avatar Oct 01 '25 02:10 github-actions[bot]