template slots: handle slots being added after the first render
Compare changes
- Reiter, Christoph authored
Instead of querying the slots in the shadow DOM after the first render just add all available slots to the light DOM. This fixes missing filled slots when slots where added after the first render, for example if they were used only after some property is set.
+ 85
− 79
@@ -4,12 +4,12 @@ export default class DBPLitElement extends AdapterLitElement {
@@ -4,12 +4,12 @@ export default class DBPLitElement extends AdapterLitElement {
@@ -18,20 +18,11 @@ export default class DBPLitElement extends AdapterLitElement {
@@ -18,20 +18,11 @@ export default class DBPLitElement extends AdapterLitElement {
// transform all global override templates or named template slots in the light DOM to named div slots
@@ -39,91 +30,106 @@ export default class DBPLitElement extends AdapterLitElement {
@@ -39,91 +30,106 @@ export default class DBPLitElement extends AdapterLitElement {
return this.shadowRoot === null ? this.querySelector(selector) : this.shadowRoot.querySelector(selector);
* Transforms all global override templates or named template slots in the light DOM to named div slots
// check if we have an "html-override" attribute set so we need to check for the global override template