Skip to content

Commit d25fe8b

Browse files
crisbetojelbourn
authored andcommitted
fix(material-experimental/mdc-chips): not disabling all animations when animations are disabled (#18440)
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. (cherry picked from commit d5a9eaa)
1 parent 4307837 commit d25fe8b

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ export class MatChip extends _MatChipMixinBase implements AfterContentInit, Afte
405405

406406
/** Whether or not the ripple should be disabled. */
407407
_isRippleDisabled(): boolean {
408-
return this.disabled || this.disableRipple || this._isBasicChip;
408+
return this.disabled || this.disableRipple || this._animationsDisabled || this._isBasicChip;
409409
}
410410

411411
static ngAcceptInputType_disabled: BooleanInput;

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919

2020
// Disables the chip enter animation.
2121
animation: none;
22+
23+
.mdc-chip__checkmark-svg {
24+
transition: none;
25+
}
2226
}
2327

2428
@include cdk-high-contrast(active, off) {
@@ -57,6 +61,10 @@
5761
pointer-events: none;
5862
opacity: 0;
5963
border-radius: inherit;
64+
65+
._mat-animation-noopable & {
66+
transition: none;
67+
}
6068
}
6169
}
6270

@@ -93,6 +101,10 @@ input.mat-mdc-chip-input {
93101
}
94102

95103
.mdc-chip__checkmark-path {
104+
._mat-animation-noopable & {
105+
transition: none;
106+
}
107+
96108
@include cdk-high-contrast(black-on-white, off) {
97109
// SVG colors won't be changed in high contrast mode and since the checkmark is white
98110
// by default, it'll blend in with the background in black-on-white mode. Override the color

0 commit comments

Comments
 (0)