diff --git a/projects/angular/clarity.api.md b/projects/angular/clarity.api.md index 758793fdc8..391542e050 100644 --- a/projects/angular/clarity.api.md +++ b/projects/angular/clarity.api.md @@ -3763,6 +3763,8 @@ export class ClrTabLink { // (undocumented) el: ElementRef; // (undocumented) + readonly id: number; + // (undocumented) ifActiveService: IfActiveService; // (undocumented) get inOverflow(): boolean; diff --git a/projects/angular/src/layout/tabs/tab-content.ts b/projects/angular/src/layout/tabs/tab-content.ts index 44391ad7fb..4228fa5cf5 100644 --- a/projects/angular/src/layout/tabs/tab-content.ts +++ b/projects/angular/src/layout/tabs/tab-content.ts @@ -49,7 +49,7 @@ export class ClrTabContent implements OnDestroy { } get ariaLabelledBy(): string { - return this.tabsService.children.find(tab => tab.tabContent === this)?.tabLink?.tabLinkId; + return this.tabsService.children.find(tab => tab.tabLink.id === this.id)?.tabLink?.tabLinkId; } // The template must be applied on the top-down phase of view-child initialization to prevent diff --git a/projects/angular/src/layout/tabs/tab-link.directive.ts b/projects/angular/src/layout/tabs/tab-link.directive.ts index c05096cfc2..f739d6ce47 100644 --- a/projects/angular/src/layout/tabs/tab-link.directive.ts +++ b/projects/angular/src/layout/tabs/tab-link.directive.ts @@ -40,7 +40,7 @@ export class ClrTabLink { constructor( public ifActiveService: IfActiveService, - @Inject(IF_ACTIVE_ID) private id: number, + @Inject(IF_ACTIVE_ID) readonly id: number, public el: ElementRef, private cfr: ComponentFactoryResolver, private viewContainerRef: ViewContainerRef,