Skip to content

Commit

Permalink
fix: emitter back
Browse files Browse the repository at this point in the history
  • Loading branch information
tshimber committed Oct 21, 2024
1 parent 8786cf6 commit 78ea95c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export class TabHeader {
return;
}
this.selected = true;
this.scaleSelect.emit();
}

@Watch('selected')
Expand Down
6 changes: 3 additions & 3 deletions packages/components/src/components/tab-nav/tab-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,8 @@ export class TabNav {
customElements.whenDefined('scale-tab-header'),
customElements.whenDefined('scale-tab-panel'),
]).then(() => {
this.linkPanels();
this.linkPanelsAndSelectTab();
this.propagateSizeToTabs();
this.selectNextTab();
});

if (this.small !== false) {
Expand Down Expand Up @@ -148,13 +147,14 @@ export class TabNav {
return tabs[tabs.length - 1];
}

linkPanels() {
linkPanelsAndSelectTab() {
const tabs = this.getAllTabs();
tabs.forEach((tab) => {
const panel = tab.nextElementSibling;
tab.setAttribute('aria-controls', panel.id);
panel.setAttribute('aria-labelledby', tab.id);
});
this.selectNextTab();
}

selectNextTab(nextTab?: HTMLScaleTabHeaderElement): void {
Expand Down

0 comments on commit 78ea95c

Please sign in to comment.