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 shadow DOM: Change target for event #2097

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

Conversation

AlyonaCh
Copy link

Fix #2096 . I changed target for event. It works for me.

@dimsemenov
Copy link
Owner

I'll look into it, this may potentially cause the event to not fire in older mobile browsers. If you have a test case with the Shadow DOM (from #2096) - please provide a link or source.

@dimsemenov
Copy link
Owner

The issue with your solution is that if a pointer is released outside of the document - the pointerup/cancel event is not fired.

This can be solved via setPointerCapture, however, it modifies event.target and makes it always the initial element, which messes up click/tap/doubletap event handling.

A similar thing happens if legacy mouse and touch events are used (mouseup, touchend etc), however, they don't have an alternative to setPointerCapture. So using setPointerCapture would also mean dropping full support for non-pointer events.

A possible solution might be to listen for pointerleave and cancel all gestures if it is triggered, but it needs testing.

I'm not sure yet what's the best approach to solve this yet, just posting the findings.

@AlyonaCh
Copy link
Author

I made a demo repo reproducing the problem: https://github.com/AlyonaCh/ShadowDOMExample
https://alyonach.github.io/ShadowDOMExample/

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.

Shadow DOM problems
2 participants