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

El.contains does not work if element no longer exists in DOM #112

Closed
aariacarterweir opened this issue Aug 16, 2019 · 0 comments
Closed

Comments

@aariacarterweir
Copy link

By the time the event bubbles, if the event.target is no longer in the DOM, el.contains will return false which incorrectly registers as an 'outside' click. This limits the usefulness of this package, fixes include:

  • Add Event.stopPropagation on every single element that is removed from the DOM after the event bubbles.
  • Use Event.composedPath() / Event.path to correctly detect event.target location at the time of the event.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant