Skip to content

Commit

Permalink
fix(bal-tabs): scope bal-tab-items
Browse files Browse the repository at this point in the history
  • Loading branch information
mladenplaninicic committed Nov 29, 2022
1 parent 4ccdc66 commit 67f1fd6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/components/src/components/bal-tabs/bal-tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export class Tabs {
private mutationO?: MutationObserver
private timeoutTimer?: NodeJS.Timer
private accordion: HTMLBalAccordionElement | null = null
private tabsId = `bal-tabs-${TabsIds++}`

@State() tabsOptions: BalTabOption[] = []
@State() lineWidth = 0
Expand Down Expand Up @@ -206,7 +207,7 @@ export class Tabs {
}

private get tabs(): HTMLBalTabItemElement[] {
return Array.from(this.el.querySelectorAll('bal-tab-item'))
return Array.from(this.el.querySelectorAll(`#${this.tabsId} > bal-tab-item`))
}

private async updateTabs() {
Expand Down Expand Up @@ -393,6 +394,7 @@ export class Tabs {
></Tabs>
</div>
<div
id={this.tabsId}
class={{
'column': this.interface !== 'meta' && this.interface !== 'navigation',
'is-full': !isVertical,
Expand All @@ -408,3 +410,5 @@ export class Tabs {
)
}
}

let TabsIds = 0

0 comments on commit 67f1fd6

Please sign in to comment.