Skip to content

Commit d2c9405

Browse files
committed
fix(tab-pane): add role="tabpanel"
1 parent 3cf48bf commit d2c9405

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

projects/coreui-angular/src/lib/tabs/tab-pane/tab-pane.component.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { booleanAttribute, ChangeDetectorRef, Component, HostBinding, OnDestroy } from '@angular/core';
1+
import { booleanAttribute, ChangeDetectorRef, Component, HostBinding, Input, OnDestroy } from '@angular/core';
22
import { Subscription } from 'rxjs';
33

44
import { TabContentComponent } from '../tab-content/tab-content.component';
@@ -12,7 +12,6 @@ import { ITabContentState, TabService } from '../tab.service';
1212
standalone: true
1313
})
1414
export class TabPaneComponent implements OnDestroy {
15-
1615
constructor(
1716
private changeDetectorRef: ChangeDetectorRef,
1817
private tabService: TabService
@@ -48,6 +47,10 @@ export class TabPaneComponent implements OnDestroy {
4847
};
4948
}
5049

50+
@Input()
51+
@HostBinding('attr.role')
52+
role = 'tabpanel';
53+
5154
ngOnDestroy(): void {
5255
this.subscribeTabService(false);
5356
}
@@ -56,7 +59,7 @@ export class TabPaneComponent implements OnDestroy {
5659
if (subscribe) {
5760
this.tabServiceSubscription = this.tabService.activeTabPaneIdx$.subscribe((tabContentState: ITabContentState) => {
5861
if (tabContentState.tabContent === this.tabContent) {
59-
this.active = (tabContentState.activeIdx === this.tabPaneIdx);
62+
this.active = tabContentState.activeIdx === this.tabPaneIdx;
6063
}
6164
});
6265
} else {

0 commit comments

Comments
 (0)