Skip to content Skip to sidebar Skip to footer

Polymer Get Element By Id From Shadow Root

I am not able to get an element by id that is in the shadow root. It will return nil. Here is the code. It is written in clojurescript. (p/defpolymer :query-component {:imports

Solution 1:

It was my understanding that getElementById will search through the shadow roots but apparently not.

None of the query methods on document will search through shadow roots, this is part of what makes them shadowy.

An exception to this rule is if you use querySelector[All] and a selector that specifically pierces shadow-roots, i.e. uses /deep/ or ::shadow).


Post a Comment for "Polymer Get Element By Id From Shadow Root"