Skip to content

Commit 1fc14a0

Browse files
tinayuangaoandrewseguin
authored andcommitted
Revert "fix(tabs): Add role to mat-tab-nav-bar and mat-tab-link" (#11657)
Material nav-tabs intentionally behaves as a nav + anchor
1 parent c536d65 commit 1fc14a0

File tree

3 files changed

+2
-22
lines changed

3 files changed

+2
-22
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<div class="mat-tab-links" (cdkObserveContent)="_alignInkBar()" role="tablist">
1+
<div class="mat-tab-links" (cdkObserveContent)="_alignInkBar()">
22
<ng-content></ng-content>
33
<mat-ink-bar></mat-ink-bar>
44
</div>
5+

src/lib/tabs/tab-nav-bar/tab-nav-bar.spec.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ describe('MatTabNavBar', () => {
1616
imports: [MatTabsModule],
1717
declarations: [
1818
SimpleTabNavBarTestApp,
19-
TabLink,
2019
TabLinkWithNgIf,
2120
TabLinkWithTabIndexBinding,
2221
TabLinkWithNativeTabindexAttr,
@@ -274,16 +273,6 @@ describe('MatTabNavBar', () => {
274273

275274
expect(tabLink.tabIndex).toBe(3, 'Expected the tabIndex to be have been set to 3.');
276275
});
277-
278-
it('should set role on tablist and tab', () => {
279-
const fixture = TestBed.createComponent(TabLink);
280-
fixture.detectChanges();
281-
282-
const tabList = fixture.debugElement.query(By.css('.mat-tab-links'));
283-
expect(tabList.nativeElement.getAttribute('role')).toEqual('tablist');
284-
const tabLinkElement = tabList.query(By.directive(MatTabLink)).nativeElement;
285-
expect(tabLinkElement.getAttribute('role')).toEqual('tab');
286-
});
287276
});
288277

289278
@Component({
@@ -312,15 +301,6 @@ class SimpleTabNavBarTestApp {
312301
activeIndex = 0;
313302
}
314303

315-
@Component({
316-
template: `
317-
<nav mat-tab-nav-bar>
318-
<a mat-tab-link role="willbeoverridden">Link</a>
319-
</nav>
320-
`
321-
})
322-
class TabLink {}
323-
324304
@Component({
325305
template: `
326306
<nav mat-tab-nav-bar>

src/lib/tabs/tab-nav-bar/tab-nav-bar.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ export const _MatTabLinkMixinBase =
172172
inputs: ['disabled', 'disableRipple', 'tabIndex'],
173173
host: {
174174
'class': 'mat-tab-link',
175-
'role': 'tab',
176175
'[attr.aria-disabled]': 'disabled.toString()',
177176
'[attr.tabIndex]': 'tabIndex',
178177
'[class.mat-tab-disabled]': 'disabled',

0 commit comments

Comments
 (0)