Skip to content

fix: file drop overlay staying active when drag leaves the drop zone#3023

Open
Vladexy88x wants to merge 1 commit into
cinnyapp:devfrom
Vladexy88x:fix-file-drop-drag-leave
Open

fix: file drop overlay staying active when drag leaves the drop zone#3023
Vladexy88x wants to merge 1 commit into
cinnyapp:devfrom
Vladexy88x:fix-file-drop-drag-leave

Conversation

@Vladexy88x

@Vladexy88x Vladexy88x commented Jul 11, 2026

Copy link
Copy Markdown

Description

Fixes: #2555
The file drop overlay (useFileDropZone) could stay active after the dragged file left the drop zone or the window, because the previous implementation tracked drag state in a ref and only deactivated on dragleave when the last state was over.

This PR replaces the ref-based state tracking with a relatedTarget check in the dragleave handler: the overlay is deactivated when the element being entered is outside the zone, or null (pointer left the window). This also lets us drop the dragStateRef and the bookkeeping in the drop/dragover handlers.

in collaboration Claude Code

Replace the drag-state ref tracking with a relatedTarget check in
dragleave, so the overlay deactivates when the pointer leaves the
zone or the window.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Vladexy88x Vladexy88x changed the title Fix file drop overlay staying active when drag leaves the drop zone fix: file drop overlay staying active when drag leaves the drop zone Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drag & drop modal gets stuck sometimes

1 participant