From 17a38a10672755110284119b00c4f33ad6ce07a8 Mon Sep 17 00:00:00 2001 From: kj Date: Fri, 31 May 2024 15:56:23 -0700 Subject: [PATCH] Only selects unnamed slot content from immediate children. --- index.mjs | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.mjs b/index.mjs index 11ebef8..1d44e25 100644 --- a/index.mjs +++ b/index.mjs @@ -31,7 +31,7 @@ const MorphdomMixin = (superclass) => class extends superclass { if (!this.shadowRoot && this['expandSlots']) { const slotEl = document.createElement('div') - const slottedElements = root.querySelectorAll('[slot=""]') + const slottedElements = root.querySelectorAll(`${this.tagName.toLowerCase()} > [slot=""]`) for (const value of slottedElements.values()) { slotEl.appendChild(value) } diff --git a/package.json b/package.json index 2a8bb7e..7a4055f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@enhance/morphdom-mixin", - "version": "1.1.3-next.0", + "version": "1.1.2", "description": "Enhance mixin to add Morphdom DOM diffing to a Custom Element", "type": "module", "module": "/dist/index.js",