Is it possible to query all elements including shadow dom with Polymer?

For example, let's say we want to do querySelectorAll ('canvas') to get all the canvases in the document, including those that are in the shadow dom. Is this possible with polymer?

+7
polymer web-component shadow-dom
source share
1 answer

Not. For some time, it was suggested to use the /deep/ combinator, but it was found to be bad for encapsulation and deprecated. The code that relies on it will break.

Instead, if you need to, you can take an element and look into your shadow root and request it inside.

+16
source share

All Articles