From 3c8d69794c67ca69b5fb856cf3f8bc4f3c79d76d Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Tue, 20 Jan 2026 20:31:12 +0100 Subject: [PATCH] fix(docs-infra): don't use private symbol Fixes that the tab group was referring to a private symbol from the CDK. (cherry picked from commit 94a8f797e5568753243637131b0c05f8ea80628c) --- .../tab-group/tab-group.component.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/adev/shared-docs/components/tab-group/tab-group.component.ts b/adev/shared-docs/components/tab-group/tab-group.component.ts index 6f97bd315e5..1c5c8f7e17b 100644 --- a/adev/shared-docs/components/tab-group/tab-group.component.ts +++ b/adev/shared-docs/components/tab-group/tab-group.component.ts @@ -18,7 +18,8 @@ import { ElementRef, ChangeDetectionStrategy, } from '@angular/core'; -import {_IdGenerator} from '@angular/cdk/a11y'; + +let idCounter = 0; /** * A simple tabs implementation with proper aria roles. @@ -36,20 +37,22 @@ import {_IdGenerator} from '@angular/cdk/a11y'; }) export class TabGroup { private readonly _renderer = inject(Renderer2); - private readonly _idGenerator = inject(_IdGenerator); private readonly _tabpanels = viewChildren>('tabpanel'); readonly tabs = input<{label: string; panel: HTMLElement}[]>(); - readonly computedTabs = computed( - () => + readonly computedTabs = computed(() => { + const id = idCounter++; + + return ( this.tabs()?.map((tab) => ({ - tabId: this._idGenerator.getId('docs-tab-'), - tabPanelId: this._idGenerator.getId('docs-tab-panel-'), + tabId: `docs-tab-${id}`, + tabPanelId: `docs-tab-panel-${id}`, label: tab.label, panel: tab.panel, - })) ?? [], - ); + })) ?? [] + ); + }); readonly selectedTab = linkedSignal(() => this.computedTabs()[0]?.tabId);