Skip to content

Commit c17f0e0

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 e0b5797 commit c17f0e0

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
@@ -404,7 +404,7 @@ export class MatChip extends _MatChipMixinBase implements AfterContentInit, Afte
404404

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

410410
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
@@ -16,6 +16,10 @@
1616
// were disabled via the `NoopAnimationsModule`, the element won't have a transition and
1717
// `transitionend` won't fire. We work around the issue by assigning a very short transition.
1818
transition-duration: 1ms;
19+
20+
.mdc-chip__checkmark-svg {
21+
transition: none;
22+
}
1923
}
2024

2125
@include cdk-high-contrast(active, off) {
@@ -54,6 +58,10 @@
5458
pointer-events: none;
5559
opacity: 0;
5660
border-radius: inherit;
61+
62+
._mat-animation-noopable & {
63+
transition: none;
64+
}
5765
}
5866
}
5967

@@ -90,6 +98,10 @@ input.mat-mdc-chip-input {
9098
}
9199

92100
.mdc-chip__checkmark-path {
101+
._mat-animation-noopable & {
102+
transition: none;
103+
}
104+
93105
@include cdk-high-contrast(black-on-white, off) {
94106
// SVG colors won't be changed in high contrast mode and since the checkmark is white
95107
// by default, it'll blend in with the background in black-on-white mode. Override the color

0 commit comments

Comments
 (0)