summaryrefslogtreecommitdiff
path: root/packages/client/src/scripts/use-tooltip.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2021-12-23 17:05:26 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2021-12-23 17:05:26 +0900
commit3a990dce7520eb1e4fabb2dbdf0860f2c60432e4 (patch)
tree5a84dd1f42dc985f56b3223dafb8c55807e8ff44 /packages/client/src/scripts/use-tooltip.ts
parentenhance(client): tweak channel pages (diff)
downloadsharkey-3a990dce7520eb1e4fabb2dbdf0860f2c60432e4.tar.gz
sharkey-3a990dce7520eb1e4fabb2dbdf0860f2c60432e4.tar.bz2
sharkey-3a990dce7520eb1e4fabb2dbdf0860f2c60432e4.zip
refactor(client): refactor
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);