From 0064b4218b375b30b65bf1c13530d8620f20d980 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Wed, 23 Oct 2024 17:46:01 +0200 Subject: [PATCH] fix(material/tabs): remove IE animation workaround (#29899) Removes a workaround that's no longer necessary now that we don't support IE. --- src/material/tabs/tab-body.ts | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/src/material/tabs/tab-body.ts b/src/material/tabs/tab-body.ts index a52281986e79..e9f3ecc5d325 100644 --- a/src/material/tabs/tab-body.ts +++ b/src/material/tabs/tab-body.ts @@ -26,7 +26,7 @@ import { inject, } from '@angular/core'; import {Subject, Subscription} from 'rxjs'; -import {distinctUntilChanged, startWith} from 'rxjs/operators'; +import {startWith} from 'rxjs/operators'; import {matTabsAnimations} from './tabs-animations'; /** @@ -174,24 +174,16 @@ export class MatTabBody implements OnInit, OnDestroy { }); } - // Ensure that we get unique animation events, because the `.done` callback can get - // invoked twice in some browsers. See https://github.com/angular/angular/issues/24084. - this._translateTabComplete - .pipe( - distinctUntilChanged((x, y) => { - return x.fromState === y.fromState && x.toState === y.toState; - }), - ) - .subscribe(event => { - // If the transition to the center is complete, emit an event. - if (this._isCenterPosition(event.toState) && this._isCenterPosition(this._position)) { - this._onCentered.emit(); - } + this._translateTabComplete.subscribe(event => { + // If the transition to the center is complete, emit an event. + if (this._isCenterPosition(event.toState) && this._isCenterPosition(this._position)) { + this._onCentered.emit(); + } - if (this._isCenterPosition(event.fromState) && !this._isCenterPosition(this._position)) { - this._afterLeavingCenter.emit(); - } - }); + if (this._isCenterPosition(event.fromState) && !this._isCenterPosition(this._position)) { + this._afterLeavingCenter.emit(); + } + }); } /**