From 166fa464a894684fcec2064bd9e75f0099336d02 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Sat, 2 Nov 2024 20:00:07 +0900 Subject: [PATCH] attempt to fix test --- packages/frontend/src/directives/tooltip.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/frontend/src/directives/tooltip.ts b/packages/frontend/src/directives/tooltip.ts index bcc3e25f05..6b546bb5d7 100644 --- a/packages/frontend/src/directives/tooltip.ts +++ b/packages/frontend/src/directives/tooltip.ts @@ -80,8 +80,8 @@ export const vTooltip = { }); src.addEventListener(start, () => { - window.clearTimeout(self.showTimer); - window.clearTimeout(self.hideTimer); + if (self.showTimer != null) window.clearTimeout(self.showTimer); + if (self.hideTimer != null) window.clearTimeout(self.hideTimer); if (delay === 0) { self.show(); } else { @@ -90,8 +90,8 @@ export const vTooltip = { }, { passive: true }); src.addEventListener(end, () => { - window.clearTimeout(self.showTimer); - window.clearTimeout(self.hideTimer); + if (self.showTimer != null) window.clearTimeout(self.showTimer); + if (self.hideTimer != null) window.clearTimeout(self.hideTimer); if (delay === 0) { self.close(); } else { @@ -100,7 +100,7 @@ export const vTooltip = { }, { passive: true }); src.addEventListener('click', () => { - window.clearTimeout(self.showTimer); + if (self.showTimer != null) window.clearTimeout(self.showTimer); self.close(); }); }, @@ -114,6 +114,6 @@ export const vTooltip = { async unmounted(src) { //@ts-expect-error HTMLElementにプロパティを追加している const self = src._tooltipDirective_; - window.clearInterval(self.checkTimer); + if (self.checkTimer != null) window.clearInterval(self.checkTimer); }, } satisfies VTooltip as VTooltip;