Skip to content

Commit

Permalink
fix(material/stepper): remove IE animation workaround (#29916)
Browse files Browse the repository at this point in the history
Removes a workaround that's no longer necessary now that we don't support IE.

(cherry picked from commit 1c19be5)
  • Loading branch information
crisbeto committed Oct 26, 2024
1 parent a2c52c1 commit 8f77546
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions src/material/stepper/stepper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 8f77546

Please sign in to comment.