From c1fa12fbd20f0125f107895067473c4c613f34f4 Mon Sep 17 00:00:00 2001 From: Danny Moerkerke Date: Tue, 13 Dec 2022 20:13:54 +0100 Subject: [PATCH] fix: narrowed the scope of the selectors that query [slot=invoker] and [slot=content] to prevent that any nested elements with [slot=invoker] and [slot=content] are moved to slot=_accordion as well --- packages/ui/components/accordion/src/LionAccordion.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ui/components/accordion/src/LionAccordion.js b/packages/ui/components/accordion/src/LionAccordion.js index f86713def..63271a949 100644 --- a/packages/ui/components/accordion/src/LionAccordion.js +++ b/packages/ui/components/accordion/src/LionAccordion.js @@ -210,10 +210,10 @@ export class LionAccordion extends LitElement { */ __rearrangeInvokersAndContent() { const invokers = /** @type {HTMLElement[]} */ ( - Array.from(this.querySelectorAll('[slot="invoker"]')) + Array.from(this.querySelectorAll(':scope > [slot="invoker"]')) ); const contents = /** @type {HTMLElement[]} */ ( - Array.from(this.querySelectorAll('[slot="content"]')) + Array.from(this.querySelectorAll(':scope > [slot="content"]')) ); const accordion = this.shadowRoot?.querySelector('slot[name=_accordion]'); if (accordion) {