{{ message }}
fix(upload): keep the drag preview under the cursor - #27542
Open
Adzouz wants to merge 1 commit into
Open
Conversation
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adzouz
marked this pull request as ready for review
September 3, 2026 12:36
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.

What does it do?
snapCenterToCursoras aDragOverlaymodifier inAssetsDndProvider, so the drag chip is centered on the pointer.@dnd-kit/modifiers@9.0.0to@strapi/upload— the same versioncontent-type-builderalready declares, so no new resolution enters the lockfile.data-testid="drag-overlay-chip"on the chip (inherited by the multi-item variant) for the e2e assertion.DragOverlayto a known chip rect and asserts the chip's center lands exactly on the pointer.grabItemAndHold()helper on the assets page object.Why is it needed?
Dragging an asset or folder showed the preview chip offset from the cursor — far enough on a grid tile to look broken.
DragOverlayhad nomodifiers, and dnd-kit anchors the overlay to the dragged node's top-left, then translates it by the pointer delta. The chip therefore trailed the cursor by exactly how far into the card or row the grab landed: a few pixels on a table row, most of a tile in grid view. The rows themselves apply no transform, so the overlay is the only moving visual and one modifier fixes both views.How to test it?
Media Library beta (
UNSTABLE_MEDIA_LIBRARY=true):Automated:
Related issue(s)/PR(s)