Skip to content

Commit 758bc86

Browse files
committed
fix(material/tooltip): Tooltip should mark for check when visibility changes
This commit fixes an error in the tooltip component where it updates a value used in a host binding without calling `markForCheck`. This does not currently throw an error because `checkNoChanges` is broken for `OnPush` components. However, the error was surfaced when testing an "exhaustive" check that will check _all_ views, regardless of their dirty state. The issue also doesn't really produce a _visible_ problem because it occurs when the tooltip is hidden so the fact that the zoom never updates doesn't make a real difference.
1 parent d0a2d3a commit 758bc86

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/material/tooltip/tooltip.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,9 @@ export class TooltipComponent implements OnDestroy {
11051105
const hideClass = this._hideAnimation;
11061106
tooltip.classList.remove(isVisible ? hideClass : showClass);
11071107
tooltip.classList.add(isVisible ? showClass : hideClass);
1108+
if (this._isVisible !== isVisible) {
1109+
this._changeDetectorRef.markForCheck();
1110+
}
11081111
this._isVisible = isVisible;
11091112

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

0 commit comments

Comments
 (0)