document.querySelector("any-component") not working
mib-kamel opened this issue · 3 comments
mib-kamel commented
Hello all
I have a problem in using document.querySelector, document.getElementById or any other selection.
it always gives me null if I want to select anything.
mib-kamel commented
i should choose this.shadowRoot instead of document
equinusocio commented
Hi @mib-kamel, when you work with shadow dom you can't querySelect
element outside the element shadow root (and you should not do it). You can select elements inside the current node shadow-root by using, as you said, this.shadowRoot
, this is the standard shadow dom behavior.
mib-kamel commented
thanks