@@ -30,7 +30,7 @@ import {AbstractControl, FormGroupDirective, NgForm} from '@angular/forms';
30
30
import { ErrorStateMatcher , ThemePalette } from '@angular/material/core' ;
31
31
import { CdkPortalOutlet , TemplatePortal } from '@angular/cdk/portal' ;
32
32
import { Subject , Subscription } from 'rxjs' ;
33
- import { takeUntil , distinctUntilChanged , map , startWith , switchMap } from 'rxjs/operators' ;
33
+ import { takeUntil , map , startWith , switchMap } from 'rxjs/operators' ;
34
34
35
35
import { MatStepHeader } from './step-header' ;
36
36
import { MatStepLabel } from './step-label' ;
@@ -226,19 +226,11 @@ export class MatStepper extends CdkStepper implements AfterContentInit {
226
226
this . _stateChanged ( ) ;
227
227
} ) ;
228
228
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
+ } ) ;
242
234
}
243
235
244
236
_stepIsNavigable ( index : number , step : MatStep ) : boolean {
0 commit comments