Skip to content

Commit ef972ad

Browse files
committed
fix(material-experimental/mdc-chips): not disabling all animations when animations are disabled
Currently the MDC chip only disables the removal animation when all animations are disabled. These changes make it so that the rest of the animations are disabled as well.
1 parent a58c725 commit ef972ad

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/material-experimental/mdc-chips/chip.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@ export class MatChip extends _MatChipMixinBase implements AfterContentInit, Afte
227227
* @docs-private
228228
*/
229229
get rippleDisabled(): boolean {
230-
return this.disabled || this.disableRipple || !!this.rippleConfig.disabled ||
231-
this._isBasicChip();
230+
return this.disabled || this.disableRipple || this._animationsDisabled ||
231+
!!this.rippleConfig.disabled || this._isBasicChip();
232232
}
233233

234234
/** The chip's leading icon. */

src/material-experimental/mdc-chips/chips.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
// were disabled via the `NoopAnimationsModule`, the element won't have a transition and
2121
// `transitionend` won't fire. We work around the issue by assigning a very short transition.
2222
transition-duration: 1ms;
23+
24+
.mdc-chip__checkmark-svg {
25+
transition: none;
26+
}
2327
}
2428

2529
@include cdk-high-contrast(active, off) {
@@ -43,6 +47,10 @@
4347
content: '';
4448
pointer-events: none;
4549
opacity: 0;
50+
51+
._mat-animation-noopable & {
52+
transition: none;
53+
}
4654
}
4755
}
4856

@@ -79,6 +87,10 @@ input.mat-mdc-chip-input {
7987
}
8088

8189
.mdc-chip__checkmark-path {
90+
._mat-animation-noopable & {
91+
transition: none;
92+
}
93+
8294
@include cdk-high-contrast(black-on-white, off) {
8395
// SVG colors won't be changed in high contrast mode and since the checkmark is white
8496
// by default, it'll blend in with the background in black-on-white mode. Override the color

0 commit comments

Comments
 (0)