Repository navigation
[6.x] Fix dragging assets onto folders in the asset selector - #15695
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, andUploaderreacted to every drag. It calledpreventDefault/stopPropagationand showed its overlay even for internal element drags. The browser'spreventDraggingonly turns off its own internal uploader, which is already off in the selector.This PR makes
Uploaderignore drags that don't carry files (noFilesindataTransfer.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.preventDragginginBrowser/AssetBrowserMixinis now redundant, but I've left it for a follow-up because #15677/#15678 touch that code.