Skip to content

[6.x] Fix dragging assets onto folders in the asset selector - #15695

Merged
jasonvarga merged 1 commit into
6.xfrom
fix-uploader-non-file-drags
Oct 21, 2026
Merged

jasonvarga merged 1 commit into
6.xfrom
fix-uploader-non-file-drags

Conversation

@jasonvarga

Copy link
Copy Markdown
Member

When you drag an asset onto a folder in an assets fieldtype's selector stack, the selector's "Drop File to Upload" overlay appears and swallows the drop, so nothing moves. The Assets page isn't affected.

The selector wraps the browser in its own Uploader, and Uploader reacted to every drag. It called preventDefault/stopPropagation and showed its overlay even for internal element drags. The browser's preventDragging only turns off its own internal uploader, which is already off in the selector.

This PR makes Uploader ignore drags that don't carry files (no Files in dataTransfer.types). They pass through untouched, so folder and breadcrumb drop targets receive them. The assets fieldtype's own "Drop to Upload" uploader had the same problem and is fixed too. Dropping real files still shows the overlay and uploads.

preventDragging in Browser/AssetBrowserMixin is now redundant, but I've left it for a follow-up because #15677/#15678 touch that code.

Dragging an existing asset inside the asset selector was swallowed by the selector's upload overlay, so it couldn't be dropped onto a folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jasonvarga
jasonvarga merged commit 95b2ea9 into 6.x Oct 21, 2026
65 checks passed
@jasonvarga
jasonvarga deleted the fix-uploader-non-file-drags branch October 21, 2026 20:02
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.

1 participant