Skip to content

Commit 63f6eb0

Browse files
committed
Revert "fix(material/tooltip): avoid problem when triggers hide animation for not visible tooltip (#24652)" (#25426)
This reverts commit 3041cda. (cherry picked from commit c95ecbe)
1 parent 0f2ec70 commit 63f6eb0

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

src/material/tooltip/tooltip.ts

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -989,22 +989,8 @@ export abstract class _TooltipComponentBase implements OnDestroy {
989989
const tooltip = this._tooltip.nativeElement;
990990
const showClass = this._showAnimation;
991991
const hideClass = this._hideAnimation;
992-
993-
if (isVisible) {
994-
tooltip.classList.remove(hideClass);
995-
tooltip.classList.add(showClass);
996-
}
997-
998-
if (!isVisible) {
999-
// It's avoids the problem when `mat-tooltip-hide` triggers the animation of
1000-
// a tooltip that has not been shown yet.
1001-
if (tooltip.classList.contains(showClass)) {
1002-
tooltip.classList.add(hideClass);
1003-
}
1004-
1005-
tooltip.classList.remove(showClass);
1006-
}
1007-
992+
tooltip.classList.remove(isVisible ? hideClass : showClass);
993+
tooltip.classList.add(isVisible ? showClass : hideClass);
1008994
this._isVisible = isVisible;
1009995

1010996
// It's common for internal apps to disable animations using `* { animation: none !important }`

0 commit comments

Comments
 (0)