-
-
Notifications
You must be signed in to change notification settings - Fork 735
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
<DayPickerInput /> choosing selected date erases value #399
Comments
Yup this is working as expected - doesn't for you? |
When you say that, do you mean that if you select a date, then click on that exact same date, you expect that the value of the input gets reset? That's not expected behavior to me. If I click on a date that's already selected, I would expect it to just stay the same How I would expect it to work:
How it's working currently (for me):
Note how these steps are the exact same except for step 7. The date picker seems to work according to the following human/computer interaction: "click on a date to populate the input". It doesn't care what the currently selected date is. It doesn't care what date you're selecting. Could be tomorrow, could be yesterday, could be 50 years in the future, could be 50 years in the past, could be today. Whatever day you choose, that day gets populated in the input. Does it seem odd to you that, in this case, clicking on a day in the calendar empties the value of the input rather than fills it? |
i see what you mean ! The original idea is to click to select a day and click again to deselect it, thus clearing the field. I agree it doesn't make much sense as this behavior could be added by the implementer. |
I've added a prop |
clickUnselectsDay = {false} .this doesn't work for me ! |
@yashsharma04 please replicate your issue here https://codesandbox.io/s/XDAE3x0W8 |
@gpbl it happens for me , but doesn't happen here https://codesandbox.io/s/XDAE3x0W8 |
@yashsharma04 please share your code, thanks! |
@yashsharma04 did you manage to fix this issue. I am stuck on same bit |
@jimniels did you manage to resolve this? |
@amit-nautiyal-crs I'm on the latest version (7.3.0) and it's fixed there. |
Thanks, @jimniels, I will give it a try |
To reproduce this bug, simply use the live
<DayPickerInput />
exampleThe text was updated successfully, but these errors were encountered: