diff --git a/.changeset/wise-boats-flow.md b/.changeset/wise-boats-flow.md new file mode 100644 index 00000000000..6a85edfdd55 --- /dev/null +++ b/.changeset/wise-boats-flow.md @@ -0,0 +1,5 @@ +--- +'@astrojs/starlight': patch +--- + +Fix issue with nested `` components diff --git a/packages/starlight/user-components/Tabs.astro b/packages/starlight/user-components/Tabs.astro index 43af0430618..82b3af179dd 100644 --- a/packages/starlight/user-components/Tabs.astro +++ b/packages/starlight/user-components/Tabs.astro @@ -77,7 +77,7 @@ const { html, panels } = processPanels(panelHtml); super(); const tablist = this.querySelector('[role="tablist"]')!; this.tabs = [...tablist.querySelectorAll('[role="tab"]')]; - this.panels = [...this.querySelectorAll('[role="tabpanel"]')]; + this.panels = [...this.querySelectorAll(':scope > [role="tabpanel"]')]; this.tabs.forEach((tab, i) => { // Handle clicks for mouse users