From 1c19be52ac154ca82e283d3965f0c61178d61fef Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Sat, 26 Oct 2024 21:10:20 +0200 Subject: [PATCH] fix(material/stepper): remove IE animation workaround (#29916) Removes a workaround that's no longer necessary now that we don't support IE. --- src/material/stepper/stepper.ts | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/material/stepper/stepper.ts b/src/material/stepper/stepper.ts index 1324db2c14a2..00b588791527 100644 --- a/src/material/stepper/stepper.ts +++ b/src/material/stepper/stepper.ts @@ -30,7 +30,7 @@ import {AbstractControl, FormGroupDirective, NgForm} from '@angular/forms'; import {ErrorStateMatcher, ThemePalette} from '@angular/material/core'; import {CdkPortalOutlet, TemplatePortal} from '@angular/cdk/portal'; import {Subject, Subscription} from 'rxjs'; -import {takeUntil, distinctUntilChanged, map, startWith, switchMap} from 'rxjs/operators'; +import {takeUntil, map, startWith, switchMap} from 'rxjs/operators'; import {MatStepHeader} from './step-header'; import {MatStepLabel} from './step-label'; @@ -226,19 +226,11 @@ export class MatStepper extends CdkStepper implements AfterContentInit { this._stateChanged(); }); - this._animationDone - .pipe( - // This needs a `distinctUntilChanged` in order to avoid emitting the same event twice due - // to a bug in animations where the `.done` callback gets invoked twice on some browsers. - // See https://github.com/angular/angular/issues/24084 - distinctUntilChanged((x, y) => x.fromState === y.fromState && x.toState === y.toState), - takeUntil(this._destroyed), - ) - .subscribe(event => { - if ((event.toState as StepContentPositionState) === 'current') { - this.animationDone.emit(); - } - }); + this._animationDone.pipe(takeUntil(this._destroyed)).subscribe(event => { + if ((event.toState as StepContentPositionState) === 'current') { + this.animationDone.emit(); + } + }); } _stepIsNavigable(index: number, step: MatStep): boolean {