Skip to content

Commit 197747e

Browse files
committed
fix(material/stepper): remove IE animation workaround (#29916)
Removes a workaround that's no longer necessary now that we don't support IE. (cherry picked from commit 1c19be5)
1 parent 809f927 commit 197747e

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

src/material/stepper/stepper.ts

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import {AbstractControl, FormGroupDirective, NgForm} from '@angular/forms';
4242
import {ErrorStateMatcher, ThemePalette} from '@angular/material/core';
4343
import {CdkPortalOutlet, TemplatePortal} from '@angular/cdk/portal';
4444
import {Subject, Subscription} from 'rxjs';
45-
import {takeUntil, distinctUntilChanged, map, startWith, switchMap} from 'rxjs/operators';
45+
import {takeUntil, map, startWith, switchMap} from 'rxjs/operators';
4646

4747
import {MatStepHeader} from './step-header';
4848
import {MatStepLabel} from './step-label';
@@ -247,19 +247,11 @@ export class MatStepper extends CdkStepper implements AfterContentInit {
247247
this._stateChanged();
248248
});
249249

250-
this._animationDone
251-
.pipe(
252-
// This needs a `distinctUntilChanged` in order to avoid emitting the same event twice due
253-
// to a bug in animations where the `.done` callback gets invoked twice on some browsers.
254-
// See https://github.com/angular/angular/issues/24084
255-
distinctUntilChanged((x, y) => x.fromState === y.fromState && x.toState === y.toState),
256-
takeUntil(this._destroyed),
257-
)
258-
.subscribe(event => {
259-
if ((event.toState as StepContentPositionState) === 'current') {
260-
this.animationDone.emit();
261-
}
262-
});
250+
this._animationDone.pipe(takeUntil(this._destroyed)).subscribe(event => {
251+
if ((event.toState as StepContentPositionState) === 'current') {
252+
this.animationDone.emit();
253+
}
254+
});
263255
}
264256

265257
_stepIsNavigable(index: number, step: MatStep): boolean {

0 commit comments

Comments
 (0)