Skip to content

Commit 2f725c9

Browse files
committed
fix(tabs): no longer use OnPush
This resolves an issue with ivy where the template content would be checked out of sync with the tab view. See #15440 for additional context.
1 parent 885d06a commit 2f725c9

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

src/material/tabs/tab-body.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ export abstract class _MatTabBodyBase implements OnInit, OnDestroy {
251251
templateUrl: 'tab-body.html',
252252
styleUrls: ['tab-body.css'],
253253
encapsulation: ViewEncapsulation.None,
254-
changeDetection: ChangeDetectionStrategy.OnPush,
254+
// tslint:disable-next-line:validate-decorators
255+
changeDetection: ChangeDetectionStrategy.Default,
255256
animations: [matTabsAnimations.translateTab],
256257
host: {
257258
'class': 'mat-tab-body',

src/material/tabs/tab-group.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,8 @@ export abstract class _MatTabGroupBase extends _MatTabGroupMixinBase implements
360360
templateUrl: 'tab-group.html',
361361
styleUrls: ['tab-group.css'],
362362
encapsulation: ViewEncapsulation.None,
363-
changeDetection: ChangeDetectionStrategy.OnPush,
363+
// tslint:disable-next-line:validate-decorators
364+
changeDetection: ChangeDetectionStrategy.Default,
364365
inputs: ['color', 'disableRipple'],
365366
host: {
366367
'class': 'mat-tab-group',

src/material/tabs/tab-header.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ export abstract class _MatTabHeaderBase extends MatPaginatedTabHeader implements
8383
inputs: ['selectedIndex'],
8484
outputs: ['selectFocusedIndex', 'indexFocused'],
8585
encapsulation: ViewEncapsulation.None,
86-
changeDetection: ChangeDetectionStrategy.OnPush,
86+
// tslint:disable-next-line:validate-decorators
87+
changeDetection: ChangeDetectionStrategy.Default,
8788
host: {
8889
'class': 'mat-tab-header',
8990
'[class.mat-tab-header-pagination-controls-enabled]': '_showPaginationControls',

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ export abstract class _MatTabNavBase extends MatPaginatedTabHeader implements Af
160160
'[class.mat-warn]': 'color === "warn"',
161161
},
162162
encapsulation: ViewEncapsulation.None,
163-
changeDetection: ChangeDetectionStrategy.OnPush,
163+
// tslint:disable-next-line:validate-decorators
164+
changeDetection: ChangeDetectionStrategy.Default,
164165
})
165166
export class MatTabNav extends _MatTabNavBase {
166167
@ContentChildren(forwardRef(() => MatTabLink), {descendants: true}) _items: QueryList<MatTabLink>;

src/material/tabs/tab.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ const _MatTabMixinBase: CanDisableCtor & typeof MatTabBase =
3838
selector: 'mat-tab',
3939
templateUrl: 'tab.html',
4040
inputs: ['disabled'],
41-
changeDetection: ChangeDetectionStrategy.OnPush,
41+
// tslint:disable-next-line:validate-decorators
42+
changeDetection: ChangeDetectionStrategy.Default,
4243
encapsulation: ViewEncapsulation.None,
4344
exportAs: 'matTab',
4445
})

0 commit comments

Comments
 (0)