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
Is it possible to use this to query the shadow DOM for SVGs? #13
Comments
@jrnail23 honestly...I haven't tried it, but if it works like regular shadow roots on web components, I don't see why it wouldn't. |
Thanks for replying, @KonnorRogers. I learned this the hard way, so I'll save any future knowledge seekers hours of pain and frustration: SVGs don't work the same as regular shadow roots. A least not in Chromium, that is. I've even tried monkey patching The one possibility I can see is if you're using |
@jrnail23 i haven't had a chance to test it yet, but best guess is the shadowRoots are closed (most WCs use open shadowRoots) shadow-dom-testing-library doesn't touch closed shadow roots. |
That's the thing, it's not even a closed shadow root, it's some kind in internal-only private implementation. If it was just a closed shadowRoot, monkey patching attachShadow to always use an open shadowRoot would've worked. 🤷🏻♂️ |
When using
<use>
in SVG, elements referenced byuse
are rendered in a shadow DOM.I've tried following the approach outlined here to query the shadow DOM via React Testing Library, where it waits for the existence of a host element's
shadowRoot
property, but in my testing,host.shadowRoot
never appears.Is it possible to get to SVG
use
elements' shadow DOM descendants with this library?The text was updated successfully, but these errors were encountered: