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
This commit is contained in:
parent
fafd922251
commit
c1fa12fbd2
1 changed files with 2 additions and 2 deletions
|
|
@ -210,10 +210,10 @@ export class LionAccordion extends LitElement {
|
||||||
*/
|
*/
|
||||||
__rearrangeInvokersAndContent() {
|
__rearrangeInvokersAndContent() {
|
||||||
const invokers = /** @type {HTMLElement[]} */ (
|
const invokers = /** @type {HTMLElement[]} */ (
|
||||||
Array.from(this.querySelectorAll('[slot="invoker"]'))
|
Array.from(this.querySelectorAll(':scope > [slot="invoker"]'))
|
||||||
);
|
);
|
||||||
const contents = /** @type {HTMLElement[]} */ (
|
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]');
|
const accordion = this.shadowRoot?.querySelector('slot[name=_accordion]');
|
||||||
if (accordion) {
|
if (accordion) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue