From 49acade942e3923334a4c99ae5267484e6b79d2a Mon Sep 17 00:00:00 2001 From: Freeplay Date: Thu, 22 Jun 2023 19:35:30 -0400 Subject: [PATCH] fix: hide tooltip on page change --- packages/client/src/directives/tooltip.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/client/src/directives/tooltip.ts b/packages/client/src/directives/tooltip.ts index 9dabd0756..e9668f28f 100644 --- a/packages/client/src/directives/tooltip.ts +++ b/packages/client/src/directives/tooltip.ts @@ -4,6 +4,8 @@ import { defineAsyncComponent, Directive, ref } from "vue"; import { isTouchUsing } from "@/scripts/touch"; import { popup, alert } from "@/os"; +import { mainRouter } from "@/router"; + const start = isTouchUsing ? "touchstart" : "mouseover"; const end = isTouchUsing ? "touchend" : "mouseleave"; @@ -99,6 +101,8 @@ export default { el.addEventListener(end, hideTooltip, { passive: true }); el.addEventListener("focusout", hideTooltip, { passive: true }); + mainRouter.on("change", hideTooltip); + el.addEventListener("click", () => { window.clearTimeout(self.showTimer); self.close();