Skip to content

Commit

Permalink
fix(material-experimental/mdc-chips): not disabling all animations wh…
Browse files Browse the repository at this point in the history
…en animations are disabled (angular#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.
  • Loading branch information
crisbeto authored Apr 20, 2020
1 parent 3e00f4c commit d5a9eaa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/material-experimental/mdc-chips/chip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ export class MatChip extends _MatChipMixinBase implements AfterContentInit, Afte

/** Whether or not the ripple should be disabled. */
_isRippleDisabled(): boolean {
return this.disabled || this.disableRipple || this._isBasicChip;
return this.disabled || this.disableRipple || this._animationsDisabled || this._isBasicChip;
}

static ngAcceptInputType_disabled: BooleanInput;
Expand Down
12 changes: 12 additions & 0 deletions src/material-experimental/mdc-chips/chips.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@

// Disables the chip enter animation.
animation: none;

.mdc-chip__checkmark-svg {
transition: none;
}
}

@include cdk-high-contrast(active, off) {
Expand Down Expand Up @@ -57,6 +61,10 @@
pointer-events: none;
opacity: 0;
border-radius: inherit;

._mat-animation-noopable & {
transition: none;
}
}
}

Expand Down Expand Up @@ -93,6 +101,10 @@ input.mat-mdc-chip-input {
}

.mdc-chip__checkmark-path {
._mat-animation-noopable & {
transition: none;
}

@include cdk-high-contrast(black-on-white, off) {
// SVG colors won't be changed in high contrast mode and since the checkmark is white
// by default, it'll blend in with the background in black-on-white mode. Override the color
Expand Down

0 comments on commit d5a9eaa

Please sign in to comment.