Skip to content

Commit 4a0397a

Browse files
committed
fix(material/tabs): remove IE animation workaround (#29899)
Removes a workaround that's no longer necessary now that we don't support IE. (cherry picked from commit 0064b42)
1 parent 501faa9 commit 4a0397a

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

src/material/tabs/tab-body.ts

+10-18
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import {
3131
ViewEncapsulation,
3232
} from '@angular/core';
3333
import {Subject, Subscription} from 'rxjs';
34-
import {distinctUntilChanged, startWith} from 'rxjs/operators';
34+
import {startWith} from 'rxjs/operators';
3535
import {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

Comments
 (0)