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

[BUG] Does not work in a web component #36

Open
imolorhe opened this issue Nov 17, 2019 · 2 comments
Open

[BUG] Does not work in a web component #36

imolorhe opened this issue Nov 17, 2019 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@imolorhe
Copy link

Describe the bug

Hey, any reason for not just passing this.paper.svg to svgPanZoom, instead of passing the SVG ID selector? I can see that svgPanZoom supports passing the svg element and not just the selector (https://github.com/ariutta/svg-pan-zoom/blob/master/src/svg-pan-zoom.js#L940).

Currently trying to integrate birdseye as a web component but this line causes svgPanZoom to fail when it tries to get the svg element using document.querySelector when the selector is passed instead of the element, with this error (Provided selector did not find any elements. Selector: #v-26). document.querySelector doesn't search through the shadow DOM of web components which is why it doesn't find the element. Passing the SVG element directly, svgPanZoom doesn't need to query the DOM for the element.

To Reproduce
Steps to reproduce the behavior:

  1. Wrap birdseye as a web component

Expected behavior
It should work when wrapped as a web component

Package
The package this issue pertains to (i.e. core, react, etc.).
core

@rohit-ravikoti
Copy link
Contributor

Hey @imolorhe!

I can definitely get working on this-- schedule has been a bit crazy lately, but will try to get it done this week. If you feel so inclined, feel free to submit a PR and I'd be happy to review 🙂

@imolorhe
Copy link
Author

Hey @rohit-ravikoti any update on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants