diff --git a/packages/block-editor/src/components/inserter-draggable-blocks/index.js b/packages/block-editor/src/components/inserter-draggable-blocks/index.js
index 0e1aaadc72e67..5a63535be3d3c 100644
--- a/packages/block-editor/src/components/inserter-draggable-blocks/index.js
+++ b/packages/block-editor/src/components/inserter-draggable-blocks/index.js
@@ -29,15 +29,6 @@ const InserterDraggableBlocks = ( {
blocks,
};
- const blocksContainMedia =
- blocks.filter(
- ( block ) =>
- ( block.name === 'core/image' ||
- block.name === 'core/audio' ||
- block.name === 'core/video' ) &&
- ( block.attributes.url || block.attributes.src )
- ).length > 0;
-
const blockTypeIcon = useSelect(
( select ) => {
const { getBlockType } = select( blocksStore );
@@ -72,7 +63,7 @@ const InserterDraggableBlocks = ( {
? [ createBlock( 'core/block', { ref: pattern.id } ) ]
: blocks;
event.dataTransfer.setData(
- blocksContainMedia ? 'default' : 'text/html',
+ 'text/html',
serialize( parsedBlocks )
);
} }
diff --git a/packages/block-editor/src/components/media-placeholder/index.js b/packages/block-editor/src/components/media-placeholder/index.js
index e7b6c836468f0..df0cd1e895c03 100644
--- a/packages/block-editor/src/components/media-placeholder/index.js
+++ b/packages/block-editor/src/components/media-placeholder/index.js
@@ -292,10 +292,8 @@ export function MediaPlaceholder( {
}
}
- async function onDrop( event ) {
- const blocks = pasteHandler( {
- HTML: event.dataTransfer?.getData( 'default' ),
- } );
+ async function onHTMLDrop( HTML ) {
+ const blocks = pasteHandler( { HTML } );
return await handleBlocksDrop( blocks );
}
@@ -385,7 +383,9 @@ export function MediaPlaceholder( {
return null;
}
- return ;
+ return (
+
+ );
};
const renderCancelLink = () => {
diff --git a/test/e2e/specs/editor/blocks/image.spec.js b/test/e2e/specs/editor/blocks/image.spec.js
index b2195f2c67688..6110a125ff6f7 100644
--- a/test/e2e/specs/editor/blocks/image.spec.js
+++ b/test/e2e/specs/editor/blocks/image.spec.js
@@ -545,7 +545,7 @@ test.describe( 'Image', () => {
dummy.style.left = 0;
dummy.draggable = 'true';
dummy.addEventListener( 'dragstart', ( event ) => {
- event.dataTransfer.setData( 'default', _html );
+ event.dataTransfer.setData( 'text/html', _html );
setTimeout( () => {
dummy.remove();
}, 0 );