Skip to content

Commit 67aa63c

Browse files
committed
fix(player): clear media layout children correctly
1 parent 7c1ce4d commit 67aa63c

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

packages/vidstack/src/elements/define/layouts/layout-element.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,8 @@ export class MediaLayoutElement extends Host(HTMLElement, MediaLayout) {
4040

4141
if (!this.query.matches) {
4242
if (isTemplate) {
43-
for (const el of this.children) {
44-
if (el.localName !== 'template') el.remove();
45-
}
43+
this.textContent = '';
44+
this.appendChild(root);
4645
} else if (isHTMLElement) {
4746
root.style.display = 'none';
4847
}

0 commit comments

Comments
 (0)