-
-
Notifications
You must be signed in to change notification settings - Fork 421
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
Feature: Use in webcomponent #536
Comments
Thanks for opening an issue. If you could put together a small example from codepen.io or jsbin.com, that would be very helpful. Don't worry that I'm closing for now. This can still be put into feature pipeline if valid. |
I think it's most simply stated that: |
Hi @timmywil , |
Yes, thanks. I don't know why I didn't reopen. It should be easy enough to fix...I think. |
Great! Thanks @timmywil ! |
Just a small question: |
The element can be, but it's attached to a document, which has a nodeType of 9. In the case of shadow DOM, we just need to allow that the owner document can be retrieved from the |
Hi @timmywil, Great library, I am trying to use the library with Lit Element. Any update on whether shadow dom will be supported. Running into the exact same issue as @Flurb was. It's a matter of determining if the element being passed in is within a shadow dom.
|
In the meantime there's a possible workaround if you're ok using web components without the shadow dom. For Lit, that's done with: createRenderRoot() { See https://lit.dev/docs/components/shadow-dom/#renderroot Note that you'll have to live without such nice features as scoped css. |
@timmywil here's a simple case in jsfiddle that triggers the "Panzoom should be called on elements that have been attached to the DOM" error: https://jsfiddle.net/a_r_w/a2m46sLf/53/. It also demonstrates the workaround from the comment above. |
Any updates on this/can this PR be integrated? This is a really awesome lib but as a user of LitElement I am completely blocked until this update is added. |
What problem does this feature solve?
I tried use create a small webcomponent which panzoom'ed an SVG map within a smaller "viewport". (based on lit-element)
The Panzoom() function returns an error, failing on the test that the panzoom element is not attached to the document - which I suppose is because of the intervening shadow DOM root.
The text was updated successfully, but these errors were encountered: