Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make an educated guess when inserting
  • Loading branch information
ockham committed Feb 27, 2024
commit 349298cabd9ebfcf7a6b2aefad98f4f0f0211e36
12 changes: 12 additions & 0 deletions packages/block-editor/src/hooks/block-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,18 @@ function BlockHooksControlPure( {
false
);
break;

default:
// If we do not know the relative position, it is because the block was
// added via a filter. In this case, we default to inserting it after the
// current block.
insertBlock(
block,
blockIndex + 1,
rootClientId, // Insert as a child of the current block's parent
false
);
break;
}
};

Expand Down