Any click on custom footer with buttons like 'Today' and 'Clear' are propagating outsideAction thus closes the datepicker
Before you start - checklist
- [X] I followed instructions in documentation written for my React-Date-Picker version
- [X] I have checked if this bug is not already reported
Description
Kind of related to https://github.com/wojtekmaj/react-calendar/issues/523 Kind of similar to 261 yet different. Also I saw @wojtekmaj somewhere else advised to wrap a Datepicker in a custom div to create any custom footer. However it triggers handleOnShouldClose with reason = 'outsideClick'.
Is there a way to still be able to close the calendar on outside click and be able to click on items inside custom footer?
Steps to reproduce
Let's imagine the structure:
<CustomWrapper>
<Datepicker .../>
<CustomFooter />
</CustomWrapper>
In custom footer we've got a clear button, however any click outside <Datepicker .../> propagates handleOnShouldClose and closes the Datepicker (unless of course we set handleOnShouldClose => ({reason}) => reason !== outsideClick...)
Expected behavior
For example, define a classname of a wrapper to trigger 'outsideClick' on anything outside it
Actual behavior
Clicking on any custom component not inside actual datepicker triggers handleOnShouldClose
Additional information
No response
Environment
- Browser (if applicable): any
- React-Date-Picker version: "^10.5.0",
- React version: 18
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 14 days.
Somehow related to https://github.com/wojtekmaj/react-date-picker/issues/640
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 14 days.
This issue was closed because it has been stalled for 14 days with no activity.