Skip to content

Commit

Permalink
Fix issue with nested <Tabs> components (#473)
Browse files Browse the repository at this point in the history
  • Loading branch information
HiDeoo authored Aug 8, 2023
1 parent 3e5d4b1 commit 6a7692a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/wise-boats-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/starlight': patch
---

Fix issue with nested `<Tabs>` components
2 changes: 1 addition & 1 deletion packages/starlight/user-components/Tabs.astro
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const { html, panels } = processPanels(panelHtml);
super();
const tablist = this.querySelector<HTMLUListElement>('[role="tablist"]')!;
this.tabs = [...tablist.querySelectorAll<HTMLAnchorElement>('[role="tab"]')];
this.panels = [...this.querySelectorAll<HTMLElement>('[role="tabpanel"]')];
this.panels = [...this.querySelectorAll<HTMLElement>(':scope > [role="tabpanel"]')];

this.tabs.forEach((tab, i) => {
// Handle clicks for mouse users
Expand Down

0 comments on commit 6a7692a

Please sign in to comment.