From a9d021af189e757fd2985ba25a852aa2e82764d8 Mon Sep 17 00:00:00 2001 From: Cyprien P Date: Tue, 4 May 2021 09:39:17 +0200 Subject: [PATCH] (core) fixes hanging Save/Revert tooltips Summary: - Clicking quickly on the small save/revert button was caussing the tooltip to stay around. - But if user waited a little bit before clicking the save button, the tooltip was shown, and then properly removed when the button was removed. - Code was missing propertly handling of disposal before the tooltip were shown. Test Plan: Added test case to the projects/tooltip.ts tests Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D2797 --- app/client/ui/tooltips.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/client/ui/tooltips.ts b/app/client/ui/tooltips.ts index 79f74bee..850c5b02 100644 --- a/app/client/ui/tooltips.ts +++ b/app/client/ui/tooltips.ts @@ -174,6 +174,9 @@ export function setHoverTooltip(refElem: Element, tipContent: ITooltipContentFun // If request, re-open on click. dom.onElem(refElem, 'click', () => { close(); open(); }); } + + // close tooltip if refElem is disposed + dom.onDisposeElem(refElem, close); } /**