Skip to content

Commit

Permalink
add tablist private getter
Browse files Browse the repository at this point in the history
  • Loading branch information
keithamus committed Feb 16, 2024
1 parent 0ed78b6 commit 09947d8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/tab-container-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,12 @@ export class TabContainerElement extends HTMLElement {
}
}

get #tabs(): HTMLElement[] {
return Array.from(this.querySelectorAll<HTMLElement>('[role="tablist"] [role="tab"]')).filter(
get #tabList() {
return this.querySelector<HTMLElement>('[role=tablist]')
}

get #tabs() {
return Array.from(this.#tabList?.querySelectorAll<HTMLElement>('[role="tab"]') || []).filter(
tab => tab instanceof HTMLElement && tab.closest(this.tagName) === this,
)
}
Expand Down

0 comments on commit 09947d8

Please sign in to comment.