From 54dc58208401a91cffbf50e3d6eec39070c28422 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sat, 30 May 2026 00:57:49 -0700 Subject: [PATCH] fix: clear floating icon menu frame from trigger ref --- .../FloatingTerminalIconContextMenu.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/renderer/src/components/floating-terminal/FloatingTerminalIconContextMenu.tsx b/src/renderer/src/components/floating-terminal/FloatingTerminalIconContextMenu.tsx index 3384ef9ef7a..68c540b6146 100644 --- a/src/renderer/src/components/floating-terminal/FloatingTerminalIconContextMenu.tsx +++ b/src/renderer/src/components/floating-terminal/FloatingTerminalIconContextMenu.tsx @@ -1,4 +1,4 @@ -import { useEffect, useMemo, useRef, useState } from 'react' +import { useCallback, useMemo, useRef, useState } from 'react' import { EyeOff, PanelBottom, PanelTop } from 'lucide-react' import { DropdownMenu, @@ -28,15 +28,14 @@ export function FloatingTerminalIconContextMenu({ const [menuPoint, setMenuPoint] = useState({ x: 0, y: 0 }) const reopenFrameRef = useRef(null) - useEffect( - () => () => { + const setTriggerRef = useCallback((node: HTMLSpanElement | null): void => { + if (node === null) { if (reopenFrameRef.current !== null) { window.cancelAnimationFrame(reopenFrameRef.current) reopenFrameRef.current = null } - }, - [] - ) + } + }, []) const moveAction = useMemo(() => { if (currentLocation === 'floating-button') { @@ -56,6 +55,7 @@ export function FloatingTerminalIconContextMenu({ return ( <>