Skip to content

Double selected month and year when previously selected and selected via keyboard #5575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Nataly19910601 opened this issue Apr 17, 2025 · 0 comments

Comments

@Nataly19910601
Copy link

When the YearPicker and MonthPicker are enabled in the react-datepicker component, and a date is already selected, clicking on a month or a year adds the classes react__month-text--keyboard-selected and react-datepicker__year-text--keyboard-selected. However, the classes react-datepicker__year-text--selected and react-datepicker__month-text--selected (or __year-text--range-start, __month-text--range-start in the case of a range) are not removed from the previously selected dates.

Steps to reproduce:

Enable YearPicker and MonthPicker in the react-datepicker component.

Select a date.

Click on a month or a year.

Notice that the old classes react-datepicker__year-text--selected and react-datepicker__month-text--selected do not disappear, and the new classes react__month-text--keyboard-selected and react-datepicker__year-text--keyboard-selected are added.

Expected behavior:
After clicking on a month or a year, the old classes should be removed, and the new classes should be added correctly.

Current version:
react-datepicke: "8.3.0"

@Nataly19910601 Nataly19910601 marked this as a duplicate of #5577 Apr 17, 2025
@Nataly19910601 Nataly19910601 marked this as a duplicate of #5576 Apr 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant