Replies: 5 comments
-
I am looking to contribute here, especially since I've used the repo and decided I would start with a bug marked as easy. @samwhale what is the use case for unselecting the date if you are clicking the selected date? - I think this is odd behavior, curious as to why this would be desired ... |
Beta Was this translation helpful? Give feedback.
-
Hi @jack1012t, good question. Although it may not be a feature that is used often, some people may click days to unselect them rather than clearing the input by key input, clearing the input using a button, or resetting the application. This could be the only way to clear the input if the input itself is disabled and the user must only change the day with the day picker overlay.
|
Beta Was this translation helpful? Give feedback.
-
Thanks @samwhale I can see that use case, if the input is disabled (sometimes easier to validate the date if you don't let the user provide the data directly), then yes, there's no way to set the date back to blank. I'll see what I can add here for a fix. |
Beta Was this translation helpful? Give feedback.
-
Ok @samwhale , a bit of an update. Running this locally, I get an error if I use the classNames from your codepen: I got yelled at in the console until I got the classNames to this point: There are two things I notice around the line you mentioned:
@gpbl it looks like these are the required classNames: http://react-day-picker.js.org/api/DayPicker/#classNames - which ones are required? |
Beta Was this translation helpful? Give feedback.
-
I'm having this same issue. Using CSS modules the .selected class never gets applied and the logic is unable to remove the date using the public method. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Similar to #689, clickUnselectsDay will not work when using classNames.
modifiers.selected
won't catch if the.selected
class when it has been hashed by classNames.codesandbox: https://codesandbox.io/s/jnkz4k2rmw. Click on a day, then click on the same day.
Expected Behavior
When clicking the selected day It should unselect and clear the input.
Actual Behavior
The selected day and input remain unchanged
Line in question:
react-day-picker/src/DayPickerInput.js
Line 480 in 1a75b44
Should be a very similar fix as #741
Beta Was this translation helpful? Give feedback.
All reactions