mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
Revert "fix(tabs): Add role to mat-tab-nav-bar and mat-tab-link" (#11657)
Material nav-tabs intentionally behaves as a nav + anchor
This commit is contained in:
committed by
Andrew Seguin
parent
9f6aa843cd
commit
b962eee745
@@ -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>
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ describe('MatTabNavBar', () => {
|
||||
imports: [MatTabsModule],
|
||||
declarations: [
|
||||
SimpleTabNavBarTestApp,
|
||||
TabLink,
|
||||
TabLinkWithNgIf,
|
||||
TabLinkWithTabIndexBinding,
|
||||
TabLinkWithNativeTabindexAttr,
|
||||
@@ -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({
|
||||
@@ -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>
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user