summaryrefslogtreecommitdiff
path: root/packages/client/src/scripts/use-tooltip.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/client/src/scripts/use-tooltip.ts')
-rw-r--r--packages/client/src/scripts/use-tooltip.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/client/src/scripts/use-tooltip.ts b/packages/client/src/scripts/use-tooltip.ts
index 0df4baca7b..d0c6756eb1 100644
--- a/packages/client/src/scripts/use-tooltip.ts
+++ b/packages/client/src/scripts/use-tooltip.ts
@@ -18,6 +18,9 @@ export function useTooltip(
const open = () => {
close();
if (!isHovering) return;
+ if (elRef.value == null) return;
+ const el = elRef.value instanceof Element ? elRef.value : elRef.value.$el;
+ if (!document.body.contains(el)) return; // openしようとしたときに既に元要素がDOMから消えている場合があるため
const showing = ref(true);
onShow(showing);