Skip to content

Commit

Permalink
Revert "fix(tabs): Add role to mat-tab-nav-bar and mat-tab-link" (#11657
Browse files Browse the repository at this point in the history
)

Material nav-tabs intentionally behaves as a nav + anchor
  • Loading branch information
tinayuangao authored and andrewseguin committed Jun 4, 2018
1 parent 9f6aa84 commit b962eee
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 22 deletions.
3 changes: 2 additions & 1 deletion src/lib/tabs/tab-nav-bar/tab-nav-bar.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<div class="mat-tab-links" (cdkObserveContent)="_alignInkBar()" role="tablist">
<div class="mat-tab-links" (cdkObserveContent)="_alignInkBar()">
<ng-content></ng-content>
<mat-ink-bar></mat-ink-bar>
</div>

20 changes: 0 additions & 20 deletions src/lib/tabs/tab-nav-bar/tab-nav-bar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ describe('MatTabNavBar', () => {
imports: [MatTabsModule],
declarations: [
SimpleTabNavBarTestApp,
TabLink,
TabLinkWithNgIf,
TabLinkWithTabIndexBinding,
TabLinkWithNativeTabindexAttr,
Expand Down Expand Up @@ -274,16 +273,6 @@ describe('MatTabNavBar', () => {

expect(tabLink.tabIndex).toBe(3, 'Expected the tabIndex to be have been set to 3.');
});

it('should set role on tablist and tab', () => {
const fixture = TestBed.createComponent(TabLink);
fixture.detectChanges();

const tabList = fixture.debugElement.query(By.css('.mat-tab-links'));
expect(tabList.nativeElement.getAttribute('role')).toEqual('tablist');
const tabLinkElement = tabList.query(By.directive(MatTabLink)).nativeElement;
expect(tabLinkElement.getAttribute('role')).toEqual('tab');
});
});

@Component({
Expand Down Expand Up @@ -312,15 +301,6 @@ class SimpleTabNavBarTestApp {
activeIndex = 0;
}

@Component({
template: `
<nav mat-tab-nav-bar>
<a mat-tab-link role="willbeoverridden">Link</a>
</nav>
`
})
class TabLink {}

@Component({
template: `
<nav mat-tab-nav-bar>
Expand Down
1 change: 0 additions & 1 deletion src/lib/tabs/tab-nav-bar/tab-nav-bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ export const _MatTabLinkMixinBase =
inputs: ['disabled', 'disableRipple', 'tabIndex'],
host: {
'class': 'mat-tab-link',
'role': 'tab',
'[attr.aria-disabled]': 'disabled.toString()',
'[attr.tabIndex]': 'tabIndex',
'[class.mat-tab-disabled]': 'disabled',
Expand Down

0 comments on commit b962eee

Please sign in to comment.