Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/cdk-experimental/tabs/tabs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,12 @@ describe('CdkTabs', () => {
expect(tabPanelElements[2].getAttribute('tabindex')).toBe('-1');
});

it('should have aria-labelledby pointing to its tab id', () => {
expect(tabPanelElements[0].getAttribute('aria-labelledby')).toBe(tabElements[0].id);
expect(tabPanelElements[1].getAttribute('aria-labelledby')).toBe(tabElements[1].id);
expect(tabPanelElements[2].getAttribute('aria-labelledby')).toBe(tabElements[2].id);
});

it('should have inert attribute when hidden and not when visible', () => {
updateTabs({selectedTab: 'tab1'});
expect(tabPanelElements[0].hasAttribute('inert')).toBe(false);
Expand Down
1 change: 1 addition & 0 deletions src/cdk-experimental/tabs/tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ export class CdkTab implements HasElement, OnInit, OnDestroy {
'[attr.id]': 'pattern.id()',
'[attr.tabindex]': 'pattern.tabindex()',
'[attr.inert]': 'pattern.hidden() ? true : null',
'[attr.aria-labelledby]': 'tab()?.id()',
},
hostDirectives: [
{
Expand Down
Loading