Skip to content

Commit

Permalink
Revert "fix(material/tooltip): avoid problem when triggers hide anima…
Browse files Browse the repository at this point in the history
…tion for not visible tooltip (#24652)" (#25426)

This reverts commit 3041cda.

(cherry picked from commit c95ecbe)
  • Loading branch information
wagnermaciel committed Aug 9, 2022
1 parent 657774e commit ab73a24
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions src/material/tooltip/tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -989,22 +989,8 @@ export abstract class _TooltipComponentBase implements OnDestroy {
const tooltip = this._tooltip.nativeElement;
const showClass = this._showAnimation;
const hideClass = this._hideAnimation;

if (isVisible) {
tooltip.classList.remove(hideClass);
tooltip.classList.add(showClass);
}

if (!isVisible) {
// It's avoids the problem when `mat-tooltip-hide` triggers the animation of
// a tooltip that has not been shown yet.
if (tooltip.classList.contains(showClass)) {
tooltip.classList.add(hideClass);
}

tooltip.classList.remove(showClass);
}

tooltip.classList.remove(isVisible ? hideClass : showClass);
tooltip.classList.add(isVisible ? showClass : hideClass);
this._isVisible = isVisible;

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

0 comments on commit ab73a24

Please sign in to comment.