Skip to content

Commit

Permalink
Fix deleting paragraph after block
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Oct 6, 2023
1 parent 9c93276 commit d5b4224
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions packages/block-editor/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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.
Expand Down

0 comments on commit d5b4224

Please sign in to comment.