Skip to content

Commit

Permalink
fix(material/tabs): remove IE animation workaround (#29899)
Browse files Browse the repository at this point in the history
Removes a workaround that's no longer necessary now that we don't support IE.
  • Loading branch information
crisbeto authored Oct 23, 2024
1 parent fa0f514 commit 0064b42
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions src/material/tabs/tab-body.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

/**
Expand Down Expand Up @@ -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();
}
});
}

/**
Expand Down

0 comments on commit 0064b42

Please sign in to comment.