Open denis-anisimov opened 4 years ago
This is most likely related to the problem described in #5574 (also introduced in 3.3.0). And the actual regression might be this one: https://github.com/Polymer/polymer/issues/5574#issuecomment-531365305
@sorvell could you investigate what would be a proper fix?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I have a page which loads
webcomponents-loader.js
,polymer
3.3.0
and this template:Please note that there is no
customElements.define(MyComponentElement.is, MyComponentElement);
line So the element is not added out of the box to the custom elements.Now I write the JS code in the console:
The element is added as a child and there is a shadow root for it.
Now I execute:
customElements.define(window.MyComponentElement.is, window.MyComponentElement);
<my-el>
shadow root is not reused and it has no expected elements there:button
anddiv
. The shadow root is just empty.If I add a new
my-el
(now when it's added tocustomElements
) then this added element has everything needed: its shadow root is not empty.The same scenario works fine with Polymer
3.2.0
.