From d1597b43a53f42bc2673bb323f96eaacca9d8ef1 Mon Sep 17 00:00:00 2001 From: zubiden <19638254+zubiden@users.noreply.github.com> Date: Mon, 1 Jun 2026 01:15:21 +0200 Subject: [PATCH] Forum Panel: Fix chatlist animation on close (#6956) --- src/components/left/main/hooks/useChatListEntry.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/components/left/main/hooks/useChatListEntry.tsx b/src/components/left/main/hooks/useChatListEntry.tsx index 5e8293d5c..6bde215fe 100644 --- a/src/components/left/main/hooks/useChatListEntry.tsx +++ b/src/components/left/main/hooks/useChatListEntry.tsx @@ -195,9 +195,15 @@ export default function useChatListEntry({ let isCancelled = false; + // Clear stale transitions before setting the compensating transform + element.classList.remove('animate-opacity', 'animate-transform'); + element.style.opacity = ''; + element.style.transform = ''; + const notifyAnimationEnd = () => { if (isCancelled) return; requestMutation(() => { + if (isCancelled) return; element.classList.remove('animate-opacity', 'animate-transform'); element.style.opacity = ''; element.style.transform = ''; @@ -210,6 +216,7 @@ export default function useChatListEntry({ element.style.opacity = '0'; requestMutation(() => { + if (isCancelled) return; element.classList.add('animate-opacity'); element.style.opacity = '1'; @@ -221,6 +228,7 @@ export default function useChatListEntry({ element.style.transform = `translate3d(0, ${-orderDiff * CHAT_HEIGHT_PX - shiftDiff}px, 0)`; requestMutation(() => { + if (isCancelled) return; element.classList.add('animate-transform'); element.style.transform = ''; @@ -232,6 +240,7 @@ export default function useChatListEntry({ element.style.transform = `translate3d(0, ${-shiftDiff}px, 0)`; requestMutation(() => { + if (isCancelled) return; element.classList.add('animate-transform'); element.style.transform = '';