react-datepicker
react-datepicker copied to clipboard
2 Dates selected when selecting a day and changing months
Describe the bug When you select a date that is available in the next or previous month you will get 2 selected dates when changing months.
To Reproduce
- Go to September 2022
- Select third of September
- Navigate to the august month
- See that 2 dates are highlighted
Expected behavior The highlighted date should only be that specific day
Screenshots
Desktop (please complete the following information):
- OS: Windows 11
- Browser Brave
- Version 1.42.97
Additional context It only seems to be a visual bug.
I'm also facing the same. Can anyone help??
add this CSS to your project, it worked for me
.react-datepicker__day--keyboard-selected { background-color: inherit !important; color: #000 !important; }
.react-datepicker__day--keyboard-selected { background-color: inherit !important; color: #000 !important; }
This CSS works but it also removes the highlight from every month.
Yeah, it's just a CSS issue where the color of keyboard-selected was too close to normal selected. I made a CSS change that makes it lighter for keyboard selected, so this issue could be closed.
In the previous solution, the highlight doesn't work on today's date.
A new solution to fix this issue also.
.react-datepicker__day--keyboard-selected {
background-color: inherit !important;
color: #000 !important;
}
.react-datepicker__day--keyboard-selected.react-datepicker__day--today {
background-color: #216ba5 !important;
color: #fff !important
}