From 43a565b93e3f3808ccbd138090de032fa5825137 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Fri, 29 May 2026 23:40:06 -0700 Subject: [PATCH] fix: clear file row drag expand timers (#3501) --- .../components/right-sidebar/useFileExplorerRowDrag.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/components/right-sidebar/useFileExplorerRowDrag.ts b/src/renderer/src/components/right-sidebar/useFileExplorerRowDrag.ts index 565f7cd96..30cb629df 100644 --- a/src/renderer/src/components/right-sidebar/useFileExplorerRowDrag.ts +++ b/src/renderer/src/components/right-sidebar/useFileExplorerRowDrag.ts @@ -1,4 +1,4 @@ -import React, { useCallback, useRef } from 'react' +import React, { useCallback, useEffect, useRef } from 'react' import { getWorkspaceFileDragPaths, WORKSPACE_FILE_PATH_MIME } from '@/lib/workspace-file-drag' const DRAG_EXPAND_DELAY_MS = 500 @@ -52,6 +52,13 @@ export function useFileExplorerRowDrag({ } }, []) + useEffect(() => { + return () => { + clearExpandTimer() + clearNativeExpandTimer() + } + }, [clearExpandTimer, clearNativeExpandTimer]) + const handleDragOver = useCallback((e: React.DragEvent) => { const isInternal = e.dataTransfer.types.includes(WORKSPACE_FILE_PATH_MIME) const isNative = e.dataTransfer.types.includes('Files')