fix: clear file row drag expand timers (#3501)

This commit is contained in:
Neil
2026-05-29 23:40:06 -07:00
committed by GitHub
parent 1c6a4adf77
commit 43a565b93e
@@ -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')