-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Selected date keep showing in all months #2565
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I'm also seeing this behavior
|
I can report this problem also. Is this a designed feature or a feature by accident (bug)? |
Same here. In the months-only view this problem is accentuated, since the same month is in the same position in all years (e.g., march is always in the first row, third column). Therefore, all years look exactly the same, which can be confusing in that it's not clear that you are switching years. |
Same issue for me |
Faced this issue too. |
This solution worked for me: https://stackoverflow.com/a/63285080/1452505 |
Try Removing adjustDateOnChange prop. This fixed for me |
A solution that worked for me was setting the minDate to null after the user clicked on next month. When the minDate is null this problem doesn't happen for me. the problem is that the Datepicker component doesn't auto rerender when setting the minDate to null so we need to do it manually and as well save the chosen date. /* To circumvent this, we are dynamically setting the minDate prop to null when the user navigates to a different month, effectively deselecting the previously selected day. However, react-datepicker doesn't automatically re-render when we update the minDate state, so it doesn't immediately reflect the updated prop. To force a re-render of react-datepicker, we generate a new key each time the month changes and apply it to the DatePicker component. Since react-datepicker doesn't provide a method to programmatically navigate between months, we maintain our own state variables for the current month and year Note: This is a workaround solution to address the current limitations of react-datepicker. In future versions of the library, const today = new Date(); const [key, setKey] = useState(Math.random().toString()); const saveMonthAndYearAndForceReRenderOfDatepicker = (date: Date) => { const handleMonthChange = (date: Date) => { <DatePicker |
If you want to maintain keyboard navigation (which you should), you can override the default css:
|
for anyone having this issue, you can pass
prop this fixed the issue for me. |
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. |
This issue was closed because it has been stalled for 10 days with no activity. |
Still hapenning. |
Describe the bug
I choose a day 2020/10/25, then all months have highlighted the day 25
Screenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: