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

Fix: Trigger outsideClickListener in capture phase to handle stopPropagation #7233

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mehdirande
Copy link

@mehdirande mehdirande commented Feb 11, 2025

This commit addresses the issue where the overlay in components does not hide when clicking outside the component, if the click event is stopped using stopPropagation on an element or its parents.

The solution changes the event listener for detecting outside clicks to be triggered in the capture phase instead of the bubbling phase. This ensures that the outside click is correctly detected even if stopPropagation is called.

Fix #7234

…agation

This commit addresses the issue where the overlay in components does not hide
when clicking outside the component, if the click event is stopped using
stopPropagation on an element or its parents.

The solution changes the event listener for detecting outside clicks to be
triggered in the capture phase instead of the bubbling phase.
This ensures that the outside click is correctly detected even if
stopPropagation is called.
Copy link

vercel bot commented Feb 11, 2025

Deployment failed with the following error:

Creating the Deployment Timed Out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Overlay Components : hide on click outside does not work if clicked element have a stopPropagation
1 participant