@@ -26,7 +26,7 @@ import {
2626 inject ,
2727} from '@angular/core' ;
2828import { Subject , Subscription } from 'rxjs' ;
29- import { distinctUntilChanged , startWith } from 'rxjs/operators' ;
29+ import { startWith } from 'rxjs/operators' ;
3030import { matTabsAnimations } from './tabs-animations' ;
3131
3232/**
@@ -174,24 +174,16 @@ export class MatTabBody implements OnInit, OnDestroy {
174174 } ) ;
175175 }
176176
177- // Ensure that we get unique animation events, because the `.done` callback can get
178- // invoked twice in some browsers. See https://github.com/angular/angular/issues/24084.
179- this . _translateTabComplete
180- . pipe (
181- distinctUntilChanged ( ( x , y ) => {
182- return x . fromState === y . fromState && x . toState === y . toState ;
183- } ) ,
184- )
185- . subscribe ( event => {
186- // If the transition to the center is complete, emit an event.
187- if ( this . _isCenterPosition ( event . toState ) && this . _isCenterPosition ( this . _position ) ) {
188- this . _onCentered . emit ( ) ;
189- }
177+ this . _translateTabComplete . subscribe ( event => {
178+ // If the transition to the center is complete, emit an event.
179+ if ( this . _isCenterPosition ( event . toState ) && this . _isCenterPosition ( this . _position ) ) {
180+ this . _onCentered . emit ( ) ;
181+ }
190182
191- if ( this . _isCenterPosition ( event . fromState ) && ! this . _isCenterPosition ( this . _position ) ) {
192- this . _afterLeavingCenter . emit ( ) ;
193- }
194- } ) ;
183+ if ( this . _isCenterPosition ( event . fromState ) && ! this . _isCenterPosition ( this . _position ) ) {
184+ this . _afterLeavingCenter . emit ( ) ;
185+ }
186+ } ) ;
195187 }
196188
197189 /**
0 commit comments