Skip to content

Prevent month changes when selecting date in the previous or next month in inline mode #5362

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
ludotg opened this issue Jan 27, 2025 · 1 comment

Comments

@ludotg
Copy link

ludotg commented Jan 27, 2025

Describe the bug
When having the DatePicker in inline mode showing, let's say January and user selects February, 1st, the displayed month changes to February.

To Reproduce
Go to inline version demo : https://reactdatepicker.com/#example-inline-version
Stay in the current month view and select the first day of the next month

The displayed month changes to the next month.

Expected behavior
The displyed month should not change

Screenshots

Image

after clicking on 2025-02-01 :

Image

Additional context
I tried setting focusSelectedMonth={false} as I read it in another issue but it did not solve the problem.

Actually, I don't know if it is the expected behaviour but it could lead to user experience issues if user does not see that the month has changed, especially when using selectsRange
So it could be great to have a have a way to disable this behaviour.

@ludotg ludotg changed the title How to prevent month changes when selecting date in the previous or next month in inline mode Prevent month changes when selecting date in the previous or next month in inline mode Jan 27, 2025
@guillermovasta
Copy link

I’m also experiencing the same error. Do you plan to fix it? Thanks!

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

2 participants