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

Selected start month is visible in next and previous years

Open bogdankol opened this issue 7 months ago • 1 comments

Describe the bug A clear and concise description of what the bug is.

You can see this on https://reactdatepicker.com/#example-date-range -> Exclude Months in Range Month Picker. If you select a range of months the starting month is being seen in next and previous years thought it is not in picked date range

To Reproduce Steps to reproduce the behavior:

  1. Go to https://reactdatepicker.com/#example-date-range -> Exclude Months in Range Month Picker
  2. Click on calendar range field
  3. Set a range of month for example from Jan 2025 to Sep 2025 and press buttons to pick any next or previuos year
  4. You should see that starting month is highlighted in wrong years

Expected behavior A clear and concise description of what you expected to happen.

In years that are not in selected months range you shouldn't see any month highlighted

Screenshots If applicable, add screenshots to help explain your problem.

Image

Image

Image

Desktop (please complete the following information):

  • OS: Win11
  • Browser chrome
  • Version 136.0.7103

Additional context Add any other context about the problem here.

bogdankol avatar May 21 '25 09:05 bogdankol

Hi, I think it is working as expected only. For example I selected July to Sept in 2024.

Image

When I switch to 2025, I didn't notice the same highlight applied here.

Image

If you are thinking why July month is highlighted here, it's actually not selected, but pre-selected for keyboard navigation to start from the previously selected date range. If you notice the highlight color is different for the selected date range and this pre-selected month

Image

SaiBalaji202 avatar Jul 13 '25 05:07 SaiBalaji202