@@ -25,6 +25,7 @@ const ALLOWED_LOCATIONS = applyFilters( 'cimo.dropZone.allowedLocations', [
2525 '.editor-styles-wrapper' , // Allowed to drop in the block editor when adding new image blocks
2626 '.uploader-window' , // Allowed to drop in the admin Media > Library grid view
2727 '.uploader-editor' , // Allowed to drop in the WooCommerce description editor
28+ '.block-library-utils__media-control' , // Allowed to drop in the block editor image block media control
2829] )
2930
3031// Add event listener to the Media Manager's drop zone
@@ -140,7 +141,7 @@ function addDropZoneListenerToMediaManager( targetDocument ) {
140141 await saveMetadata ( conversionMetadata )
141142
142143 // Find the correct target to dispatch the event to
143- let target = event . target
144+ let target = event . target . closest ( '.components-drop-zone, [data-is-drop-zone="true"]' ) || event . target
144145 // This specifically handles the WooCommerce/classic description editor
145146 if ( event . target ?. closest ( '.uploader-editor-content' ) ) {
146147 target = event . target . closest ( '.uploader-editor-content' )
@@ -154,7 +155,7 @@ function addDropZoneListenerToMediaManager( targetDocument ) {
154155 // inside the DropZoneComponent.
155156 //
156157 // @see https://github.com/WordPress/gutenberg/blob/f8140c4fcc8db2d6078ad76fd433c79df3543860/packages/components/src/drop-zone/index.tsx#L59
157- if ( target ?. classList . contains ( 'components-drop-zone' ) || target ?. classList . contains ( 'uploader-editor-content' ) ) {
158+ if ( target ?. classList . contains ( 'components-drop-zone' ) || target ?. getAttribute ( 'data-is-drop-zone' ) === 'true' || target ?. classList . contains ( 'uploader-editor-content' ) ) {
158159 // Create a drop event with conditional bubbling
159160 // Use bubbles: false when in iframe to prevent doubling, but true for main document
160161 const isInIframe = targetDocument !== document
0 commit comments