Skip to content

Commit c95ecbe

Browse files
authored
Revert "fix(material/tooltip): avoid problem when triggers hide animation for not visible tooltip (#24652)" (#25426)
This reverts commit 3041cda.
1 parent dc74aa3 commit c95ecbe

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
@@ -1018,22 +1018,8 @@ export abstract class _TooltipComponentBase implements OnDestroy {
10181018
const tooltip = this._tooltip.nativeElement;
10191019
const showClass = this._showAnimation;
10201020
const hideClass = this._hideAnimation;
1021-
1022-
if (isVisible) {
1023-
tooltip.classList.remove(hideClass);
1024-
tooltip.classList.add(showClass);
1025-
}
1026-
1027-
if (!isVisible) {
1028-
// It's avoids the problem when `mat-tooltip-hide` triggers the animation of
1029-
// a tooltip that has not been shown yet.
1030-
if (tooltip.classList.contains(showClass)) {
1031-
tooltip.classList.add(hideClass);
1032-
}
1033-
1034-
tooltip.classList.remove(showClass);
1035-
}
1036-
1021+
tooltip.classList.remove(isVisible ? hideClass : showClass);
1022+
tooltip.classList.add(isVisible ? showClass : hideClass);
10371023
this._isVisible = isVisible;
10381024

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

0 commit comments

Comments
 (0)