chore: - simplified selectors for content and invoker

- mentioned accordion in changeset
This commit is contained in:
Danny Moerkerke 2022-12-14 13:15:12 +01:00 committed by Thomas Allmer
parent 49092c97aa
commit 71906ed316
2 changed files with 3 additions and 3 deletions

View file

@ -2,4 +2,4 @@
'@lion/ui': patch '@lion/ui': patch
--- ---
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 `accordion`: 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

View file

@ -210,10 +210,10 @@ export class LionAccordion extends LitElement {
*/ */
__rearrangeInvokersAndContent() { __rearrangeInvokersAndContent() {
const invokers = /** @type {HTMLElement[]} */ ( const invokers = /** @type {HTMLElement[]} */ (
Array.from(this.querySelectorAll(':scope > [slot="invoker"]')) Array.from(this.children).filter(child => child.slot === 'invoker')
); );
const contents = /** @type {HTMLElement[]} */ ( const contents = /** @type {HTMLElement[]} */ (
Array.from(this.querySelectorAll(':scope > [slot="content"]')) Array.from(this.children).filter(child => child.slot === 'content')
); );
const accordion = this.shadowRoot?.querySelector('slot[name=_accordion]'); const accordion = this.shadowRoot?.querySelector('slot[name=_accordion]');
if (accordion) { if (accordion) {