Skip to content

Commit 1c19be5

Browse files
authored
fix(material/stepper): remove IE animation workaround (angular#29916)
Removes a workaround that's no longer necessary now that we don't support IE.
1 parent bb7563a commit 1c19be5

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
@@ -30,7 +30,7 @@ import {AbstractControl, FormGroupDirective, NgForm} from '@angular/forms';
3030
import {ErrorStateMatcher, ThemePalette} from '@angular/material/core';
3131
import {CdkPortalOutlet, TemplatePortal} from '@angular/cdk/portal';
3232
import {Subject, Subscription} from 'rxjs';
33-
import {takeUntil, distinctUntilChanged, map, startWith, switchMap} from 'rxjs/operators';
33+
import {takeUntil, map, startWith, switchMap} from 'rxjs/operators';
3434

3535
import {MatStepHeader} from './step-header';
3636
import {MatStepLabel} from './step-label';
@@ -226,19 +226,11 @@ export class MatStepper extends CdkStepper implements AfterContentInit {
226226
this._stateChanged();
227227
});
228228

229-
this._animationDone
230-
.pipe(
231-
// This needs a `distinctUntilChanged` in order to avoid emitting the same event twice due
232-
// to a bug in animations where the `.done` callback gets invoked twice on some browsers.
233-
// See https://github.com/angular/angular/issues/24084
234-
distinctUntilChanged((x, y) => x.fromState === y.fromState && x.toState === y.toState),
235-
takeUntil(this._destroyed),
236-
)
237-
.subscribe(event => {
238-
if ((event.toState as StepContentPositionState) === 'current') {
239-
this.animationDone.emit();
240-
}
241-
});
229+
this._animationDone.pipe(takeUntil(this._destroyed)).subscribe(event => {
230+
if ((event.toState as StepContentPositionState) === 'current') {
231+
this.animationDone.emit();
232+
}
233+
});
242234
}
243235

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

0 commit comments

Comments
 (0)