Skip to content

Commit f950343

Browse files
committed
feat(material/tabs): Nit change
1 parent e9dda66 commit f950343

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ export abstract class _MatTabNavBase
145145

146146
if (this.panel) {
147147
this.panel._activeTabId = items[i]._uniqueId;
148-
this.panel._cdr.markForCheck();
149148
}
150149

151150
return;
@@ -169,13 +168,13 @@ export abstract class _MatTabNavBase
169168
templateUrl: 'tab-nav-bar.html',
170169
styleUrls: ['tab-nav-bar.css'],
171170
host: {
171+
'[attr.role]': 'panel ? "tablist" : null',
172172
'class': 'mat-tab-nav-bar mat-tab-header',
173173
'[class.mat-tab-header-pagination-controls-enabled]': '_showPaginationControls',
174174
'[class.mat-tab-header-rtl]': "_getLayoutDirection() == 'rtl'",
175175
'[class.mat-primary]': 'color !== "warn" && color !== "accent"',
176176
'[class.mat-accent]': 'color === "accent"',
177177
'[class.mat-warn]': 'color === "warn"',
178-
'[attr.role]': 'panel ? "tablist" : null',
179178
},
180179
encapsulation: ViewEncapsulation.None,
181180
// tslint:disable-next-line:validate-decorators
@@ -341,6 +340,7 @@ export class _MatTabLinkBase
341340
'[attr.aria-current]': 'active && !_tabNavBar.panel ? "page" : null',
342341
'[attr.aria-disabled]': 'disabled',
343342
'[attr.aria-selected]': '_tabNavBar.panel ? (active ? "true" : "false") : null',
343+
'[attr.id]': '_uniqueId',
344344
'[attr.tabIndex]': '_getTabIndex()',
345345
'[attr.role]': '_tabNavBar.panel ? "tab" : null',
346346
'[class.mat-tab-disabled]': 'disabled',
@@ -383,6 +383,7 @@ export class MatTabLink extends _MatTabLinkBase implements OnDestroy {
383383
template: '<ng-content select="router-outlet"></ng-content>',
384384
host: {
385385
'[attr.aria-labelledby]': '_activeTabId || null',
386+
'[attr.id]': '_uniqueId',
386387
'role': 'tabpanel',
387388
},
388389
encapsulation: ViewEncapsulation.None,
@@ -395,6 +396,4 @@ export class MatTabNavPanel {
395396

396397
/** Unique id for the component referenced in ARIA attributes. */
397398
_uniqueId = `mat-tab-nav-panel-${nextUniqueId++}`;
398-
399-
constructor(readonly _cdr: ChangeDetectorRef) {}
400399
}

0 commit comments

Comments
 (0)