@@ -42,7 +42,7 @@ import {AbstractControl, FormGroupDirective, NgForm} from '@angular/forms';
42
42
import { ErrorStateMatcher , ThemePalette } from '@angular/material/core' ;
43
43
import { CdkPortalOutlet , TemplatePortal } from '@angular/cdk/portal' ;
44
44
import { Subject , Subscription } from 'rxjs' ;
45
- import { takeUntil , distinctUntilChanged , map , startWith , switchMap } from 'rxjs/operators' ;
45
+ import { takeUntil , map , startWith , switchMap } from 'rxjs/operators' ;
46
46
47
47
import { MatStepHeader } from './step-header' ;
48
48
import { MatStepLabel } from './step-label' ;
@@ -247,19 +247,11 @@ export class MatStepper extends CdkStepper implements AfterContentInit {
247
247
this . _stateChanged ( ) ;
248
248
} ) ;
249
249
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
+ } ) ;
263
255
}
264
256
265
257
_stepIsNavigable ( index : number , step : MatStep ) : boolean {
0 commit comments