From e00fdc2d5986b3f12b93e410ae7e191da8fe5315 Mon Sep 17 00:00:00 2001 From: YAVIIGI <118232419+YAVIIGI@users.noreply.github.com> Date: Tue, 3 Oct 2023 11:27:51 +0900 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20use-tooltip=20=E3=81=AE?= =?UTF-8?q?=E5=91=BC=E3=81=B3=E5=87=BA=E3=81=97=E5=85=83=E3=81=AE=20UI=20?= =?UTF-8?q?=E3=81=8C=E7=84=A1=E3=81=8F=E3=81=AA=E3=81=A3=E3=81=9F=E3=82=89?= =?UTF-8?q?=E8=87=AA=E5=8B=95=E7=9A=84=E3=81=AB=E5=89=8A=E9=99=A4=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= =?UTF-8?q?=20(#11949)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update use-tooltip.ts * Update CHANGELOG.md --- CHANGELOG.md | 1 + packages/frontend/src/scripts/use-tooltip.ts | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee2f11b156..c6cadf54b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ - Enhance: AiScriptでホストのアドレスを参照する定数`SERVER_URL`を追加 - Enhance: モデレーションログ機能の強化 - Enhance: ローカリゼーションの更新 +- Fix: リアクションしたユーザ一覧のUIが稀に左上に残ってしまう不具合を修正 ### Server - Fix: Redisに古いバージョンのキャッシュが残っている場合、キャッシュが消えるまでの間通知が届かなくなる問題を修正 diff --git a/packages/frontend/src/scripts/use-tooltip.ts b/packages/frontend/src/scripts/use-tooltip.ts index 0a82997728..17ea380db0 100644 --- a/packages/frontend/src/scripts/use-tooltip.ts +++ b/packages/frontend/src/scripts/use-tooltip.ts @@ -21,6 +21,8 @@ export function useTooltip( let changeShowingState: (() => void) | null; + let autoHidingTimer; + const open = () => { close(); if (!isHovering) return; @@ -33,6 +35,16 @@ export function useTooltip( changeShowingState = () => { showing.value = false; }; + + autoHidingTimer = window.setInterval(() => { + if (!document.body.contains(elRef.value)) { + if (!isHovering) return; + isHovering = false; + window.clearTimeout(timeoutId); + close(); + window.clearInterval(autoHidingTimer); + } + }, 1000); }; const close = () => { @@ -53,6 +65,7 @@ export function useTooltip( if (!isHovering) return; isHovering = false; window.clearTimeout(timeoutId); + window.clearInterval(autoHidingTimer); close(); }; @@ -67,6 +80,7 @@ export function useTooltip( if (!isHovering) return; isHovering = false; window.clearTimeout(timeoutId); + window.clearInterval(autoHidingTimer); close(); };