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
Shadow DOM problems #2096
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using PhotoSwipe inside a shadow root, zoom functionality fails when clicking on an image, and closing the gallery fails when clicking on the background. This issue arises because the event is attached to the window using "events.add(window)". Consequently, the event's target becomes the host element of the shadow root, rather than the element clicked by the user. This leads to the problem because PhotoSwipe relies on the presence of classes like 'pswp__img', 'pswp__item', 'pswp__zoom-wrap' when processing a click, which the host element lacks. The solution lies in attaching the event not to the window, but to an element within the shadow root. Is it possible to specify the element to which events are attached in the options?
The text was updated successfully, but these errors were encountered: