Skip to content

Commit

Permalink
fix(blockquote-tabs): update event-listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarmarina committed Jul 26, 2024
1 parent a702bfe commit 1986199
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions packages/components/blockquote-tabs/src/BlockquoteTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ export class BlockquoteTabs extends BlockquoteMixinSlotContent(LitElement) {
},
skipInitial: true,
});

this.addEventListener('slotchanges', this._onSlotChanges);
}

_selectedIsInRange(idx) {
Expand All @@ -145,11 +147,6 @@ export class BlockquoteTabs extends BlockquoteMixinSlotContent(LitElement) {
return this._tabList.length;
}

connectedCallback() {
super.connectedCallback?.();
this.shadowRoot?.addEventListener('slotchanges', this._onSlotChanges);
}

firstUpdated(props) {
super.firstUpdated && super.firstUpdated(props);
const tabSlot = this.shadowRoot?.querySelector('[name="tab"]');
Expand Down
4 changes: 2 additions & 2 deletions packages/components/blockquote-tabs/src/tab/BlockquoteTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export class BlockquoteTab extends BlockquoteMixinSlotContent(LitElement) {
slot: 'tab',
tabindex: 0,
};

this.addEventListener('slotchanges', this._onSlotChanges);
}

static get styles() {
Expand All @@ -38,8 +40,6 @@ export class BlockquoteTab extends BlockquoteMixinSlotContent(LitElement) {

connectedCallback() {
super.connectedCallback?.();
this.shadowRoot?.addEventListener('slotchanges', this._onSlotChanges);

this.__setArrayAttibute(this.globalRootAttributes);
}

Expand Down

0 comments on commit 1986199

Please sign in to comment.