react-date-picker icon indicating copy to clipboard operation
react-date-picker copied to clipboard

Any click on custom footer with buttons like 'Today' and 'Clear' are propagating outsideAction thus closes the datepicker

Open mikhail-yahorau opened this issue 2 years ago • 3 comments

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

mikhail-yahorau avatar Oct 02 '23 13:10 mikhail-yahorau

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.

github-actions[bot] avatar Jan 01 '24 00:01 github-actions[bot]

Somehow related to https://github.com/wojtekmaj/react-date-picker/issues/640

mikhail-yahorau avatar Jan 10 '24 13:01 mikhail-yahorau

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.

github-actions[bot] avatar Apr 15 '24 02:04 github-actions[bot]

This issue was closed because it has been stalled for 14 days with no activity.

github-actions[bot] avatar May 06 '24 00:05 github-actions[bot]