@@ -31,7 +31,7 @@ import {
3131 ViewEncapsulation ,
3232} from '@angular/core' ;
3333import { Subject , Subscription } from 'rxjs' ;
34- import { distinctUntilChanged , startWith } from 'rxjs/operators' ;
34+ import { startWith } from 'rxjs/operators' ;
3535import { matTabsAnimations } from './tabs-animations' ;
3636
3737/**
@@ -180,24 +180,16 @@ export class MatTabBody implements OnInit, OnDestroy {
180180 } ) ;
181181 }
182182
183- // Ensure that we get unique animation events, because the `.done` callback can get
184- // invoked twice in some browsers. See https://github.com/angular/angular/issues/24084.
185- this . _translateTabComplete
186- . pipe (
187- distinctUntilChanged ( ( x , y ) => {
188- return x . fromState === y . fromState && x . toState === y . toState ;
189- } ) ,
190- )
191- . subscribe ( event => {
192- // If the transition to the center is complete, emit an event.
193- if ( this . _isCenterPosition ( event . toState ) && this . _isCenterPosition ( this . _position ) ) {
194- this . _onCentered . emit ( ) ;
195- }
183+ this . _translateTabComplete . subscribe ( event => {
184+ // If the transition to the center is complete, emit an event.
185+ if ( this . _isCenterPosition ( event . toState ) && this . _isCenterPosition ( this . _position ) ) {
186+ this . _onCentered . emit ( ) ;
187+ }
196188
197- if ( this . _isCenterPosition ( event . fromState ) && ! this . _isCenterPosition ( this . _position ) ) {
198- this . _afterLeavingCenter . emit ( ) ;
199- }
200- } ) ;
189+ if ( this . _isCenterPosition ( event . fromState ) && ! this . _isCenterPosition ( this . _position ) ) {
190+ this . _afterLeavingCenter . emit ( ) ;
191+ }
192+ } ) ;
201193 }
202194
203195 /**
0 commit comments