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

Drag and drop not working for iFrame panels within a Shadow DOM #774

Open
Ben-Barron opened this issue Nov 22, 2024 · 2 comments · May be fixed by #791
Open

Drag and drop not working for iFrame panels within a Shadow DOM #774

Ben-Barron opened this issue Nov 22, 2024 · 2 comments · May be fixed by #791
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Ben-Barron
Copy link

disableIFramePointerEvents() doesn't work when within a Shadow DOM, so you can't use drag'n'drop with iFrames in a Shadow DOM.

At a guess, you could fix by passing this.el.ownerDocument into the method call here.

I was unable to find any workarounds based on the exposed event handlers.

@Ben-Barron
Copy link
Author

Ben-Barron commented Nov 23, 2024

.ownerDocument won't work actually, https://developer.mozilla.org/en-US/docs/Web/API/Node/getRootNode is more appropriate as it'll work in Shadow DOM or not (according to docs)

@mathuo mathuo linked a pull request Dec 10, 2024 that will close this issue
@mathuo
Copy link
Owner

mathuo commented Dec 10, 2024

This is an interesting one. For this to work at the time of the drag event starting you need to find every iframe element that exists within the standard and shadow DOM.

As far I know there is no method for "give me all shadow DOMs" so the best I have current is this which I am not a fan of due to the use of querySelectorAll('*')...

If anybody has a better solution I would love to hear it!

I could potentially include my change, perhaps with a optional flag to explicitly enable this behaviour since the querySelectorAll('*') has the potential to be an expensive call but I would like to leave this issue open for a while to see if any suggestions role in.

@mathuo mathuo added bug Something isn't working help wanted Extra attention is needed labels Dec 10, 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 help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants