Skip to content

Commit a9aa27f

Browse files
committed
Remove language name or title from code block tab when only a single tab is present (no grouping for tabbed code blocks)
1 parent fa20be8 commit a9aa27f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • src/components/Code/CodeTabs/client

‎src/components/Code/CodeTabs/client/index.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ export class CodeTabsElement extends LitElement {
143143
button.textContent = tabLabel
144144
button.setAttribute('data-code-tabs-button', String(index))
145145

146+
/** Single-tab blocks show a language label that is not interactive */
147+
if (!args.shouldRenderTabs || !this.isInteractiveTabs) {
148+
button.tabIndex = -1
149+
}
150+
146151
addButtonEventListeners(button, () => this.setActive(index), this)
147152

148153
li.append(button)

0 commit comments

Comments
 (0)