Skip to content

Commit 1a800de

Browse files
committed
fix(material/tabs): resolve change after checked errors
Fixes some "change after checked" errors in the tab nav bar. (cherry picked from commit a915587)
1 parent 12f96e2 commit 1a800de

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

goldens/material/tabs/index.api.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,8 @@ export class MatTabLink extends InkBarItem implements AfterViewInit, OnDestroy,
401401
get active(): boolean;
402402
set active(value: boolean);
403403
disabled: boolean;
404-
disableRipple: boolean;
404+
get disableRipple(): boolean;
405+
set disableRipple(value: boolean);
405406
// (undocumented)
406407
elementRef: ElementRef<any>;
407408
focus(): void;
@@ -452,7 +453,8 @@ export class MatTabNav extends MatPaginatedTabHeader implements AfterContentInit
452453
get backgroundColor(): ThemePalette;
453454
set backgroundColor(value: ThemePalette);
454455
color: ThemePalette;
455-
disableRipple: boolean;
456+
get disableRipple(): boolean;
457+
set disableRipple(value: boolean);
456458
get fitInkBarToContent(): boolean;
457459
set fitInkBarToContent(value: boolean);
458460
// (undocumented)

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

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,7 @@ import {
77
dispatchMouseEvent,
88
provideFakeDirectionality,
99
} from '@angular/cdk/testing/private';
10-
import {
11-
Component,
12-
provideCheckNoChangesConfig,
13-
QueryList,
14-
signal,
15-
ViewChild,
16-
ViewChildren,
17-
WritableSignal,
18-
} from '@angular/core';
10+
import {Component, QueryList, signal, ViewChild, ViewChildren, WritableSignal} from '@angular/core';
1911
import {ComponentFixture, fakeAsync, TestBed, tick, waitForAsync} from '@angular/core/testing';
2012
import {By} from '@angular/platform-browser';
2113
import {Subject} from 'rxjs';
@@ -41,7 +33,6 @@ describe('MatTabNavBar', () => {
4133
TabBarWithInactiveTabsOnInit,
4234
],
4335
providers: [
44-
provideCheckNoChangesConfig({exhaustive: false}),
4536
{provide: MAT_RIPPLE_GLOBAL_OPTIONS, useFactory: () => globalRippleOptions},
4637
provideFakeDirectionality(dir),
4738
],

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,13 @@ export class MatTabNav extends MatPaginatedTabHeader implements AfterContentInit
131131

132132
/** Whether the ripple effect is disabled or not. */
133133
@Input({transform: booleanAttribute})
134-
disableRipple: boolean = false;
134+
get disableRipple() {
135+
return this._disableRipple();
136+
}
137+
set disableRipple(value: boolean) {
138+
this._disableRipple.set(value);
139+
}
140+
private _disableRipple = signal(false);
135141

136142
/**
137143
* Theme color of the nav bar. This API is supported in M2 themes only, it has
@@ -297,7 +303,13 @@ export class MatTabLink
297303

298304
/** Whether ripples are disabled on the tab link. */
299305
@Input({transform: booleanAttribute})
300-
disableRipple: boolean = false;
306+
get disableRipple() {
307+
return this._disableRipple();
308+
}
309+
set disableRipple(value: boolean) {
310+
this._disableRipple.set(value);
311+
}
312+
private _disableRipple = signal(false);
301313

302314
@Input({
303315
transform: (value: unknown) => (value == null ? 0 : numberAttribute(value)),

0 commit comments

Comments
 (0)