Skip to content

Conversation

@Arukuen
Copy link

@Arukuen Arukuen commented Dec 15, 2025

…ia-frame-uploader to engage

fixes #3

Issue: When dropping a media without waiting for the .media-frame-uploader to engage (quickly dropping without waiting for the blue drop indicator), the target becomes the HTML element where the drop happened. This fix uses a fallback to allow dropping inside the Media Manager modal.

@coderabbitai
Copy link

coderabbitai bot commented Dec 15, 2025

Walkthrough

The drop-zone drag-and-drop validation logic was expanded to support a secondary fallback region. When the drop target is not within the primary .media-frame-uploader element, the code now checks for a .supports-drag-drop ancestor containing a .media-frame-uploader, enabling drop handling in an additional UI area.

Changes

Cohort / File(s) Summary
Drag-drop validation enhancement
src/admin/js/media-manager/drop-zone.js
Added fallback drop target validation to check for .supports-drag-drop ancestor containing .media-frame-uploader when primary target is not found, allowing drag-and-drop in secondary regions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Single-file change with focused scope
  • Clear, linear addition of fallback validation logic
  • Review should focus on: ensuring fallback logic doesn't introduce unintended drop zones, and verifying selector specificity and DOM traversal order

Poem

🐰 A dropzone grows a second heart,
Where drags and drops find extra art,
The fallback whispers, "Drop here too!"
Two paths to upload, old and new!


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Free

📥 Commits

Reviewing files that changed from the base of the PR and between 5ae075e and a5cce8a.

📒 Files selected for processing (1)
  • src/admin/js/media-manager/drop-zone.js (1 hunks)

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

Dragging a multiple images quickly doesn't convert the image

2 participants