From eee57907d93e6ff108a3bdb74611526b11b3ca9b Mon Sep 17 00:00:00 2001 From: Jarda Snajdr Date: Mon, 25 Mar 2024 13:06:42 +0100 Subject: [PATCH] Fix root ID calculation when check if block can be transformed --- packages/block-editor/src/components/block-switcher/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/block-switcher/index.js b/packages/block-editor/src/components/block-switcher/index.js index 2d75b80269efe6..8b01907474d23a 100644 --- a/packages/block-editor/src/components/block-switcher/index.js +++ b/packages/block-editor/src/components/block-switcher/index.js @@ -182,7 +182,9 @@ export const BlockSwitcher = ( { clientIds, disabled } ) => { if ( ! _blocks.length || _blocks.some( ( block ) => ! block ) ) { return { invalidBlocks: true }; } - const rootClientId = getBlockRootClientId( clientIds ); + const rootClientId = getBlockRootClientId( + Array.isArray( clientIds ) ? clientIds[ 0 ] : clientIds + ); const [ { name: firstBlockName } ] = _blocks; const _isSingleBlockSelected = _blocks.length === 1; const blockType = getBlockType( firstBlockName );