shadycss icon indicating copy to clipboard operation
shadycss copied to clipboard

[bug] Custom Elements fail to upgrade when inserted into slotted context

Open ruphin opened this issue 8 years ago • 1 comments

When inserting a Custom Element into an element that is distributing children into slots, the Custom Element is not upgraded.

This problem was originally found when using lit-html to re-render lists inside an element with slotted content: Polymer/lit-html#392

A reproduction of the issue can be found here: https://codepen.io/ruphin/pen/BPNPgy?editors=1010

The issue was probably not discovered before, because the MutationObserver would most likely handle the first nodes causing them to be upgraded as normal. However, once the MutationObserver is disconnected the patched functions fail to trigger. This happens because _asyncRender uses the native insertBefore instead of the patched one.

ruphin avatar Jul 13 '18 03:07 ruphin

Wrong repo, sorry!

ruphin avatar Jul 13 '18 03:07 ruphin