Skip to content
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

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

Closed
2 tasks done
mikhail-yahorau opened this issue Oct 2, 2023 · 4 comments
Labels
bug Something isn't working stale

Comments

@mikhail-yahorau
Copy link

mikhail-yahorau commented Oct 2, 2023

Before you start - checklist

  • I followed instructions in documentation written for my React-Date-Picker version
  • I have checked if this bug is not already reported

Description

Kind of related to wojtekmaj/react-calendar#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
Copy link
Contributor

github-actions bot commented Jan 1, 2024

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 github-actions bot added the stale label Jan 1, 2024
@mikhail-yahorau
Copy link
Author

Somehow related to #640

@github-actions github-actions bot removed the stale label Jan 15, 2024
Copy link
Contributor

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 github-actions bot added the stale label Apr 15, 2024
Copy link
Contributor

github-actions bot commented May 6, 2024

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

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

1 participant