diff --git a/packages/block-editor/src/store/actions.js b/packages/block-editor/src/store/actions.js index 72cfaeabd66c7d..fa4d651fe79b27 100644 --- a/packages/block-editor/src/store/actions.js +++ b/packages/block-editor/src/store/actions.js @@ -1012,7 +1012,20 @@ export const mergeBlocks = const blockA = select.getBlock( clientIdA ); if ( isUnmodifiedDefaultBlock( blockA ) ) { - dispatch.removeBlock( clientIdA, false ); + dispatch.removeBlock( + clientIdA, + select.isBlockSelected( clientIdA ) + ); + return; + } + + const blockB = select.getBlock( clientIdB ); + + if ( isUnmodifiedDefaultBlock( blockB ) ) { + dispatch.removeBlock( + clientIdB, + select.isBlockSelected( clientIdB ) + ); return; } @@ -1028,8 +1041,6 @@ export const mergeBlocks = return; } - const blockB = select.getBlock( clientIdB ); - if ( ! blockAType.merge ) { // If there's no merge function defined, attempt merging inner // blocks.