Skip to content

Commit

Permalink
Fix root ID calculation when check if block can be transformed (#60167)
Browse files Browse the repository at this point in the history
Co-authored-by: jsnajdr <jsnajdr@git.wordpress.org>
Co-authored-by: mcsf <mcsf@git.wordpress.org>
Co-authored-by: annezazu <annezazu@git.wordpress.org>
Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
  • Loading branch information
5 people committed Mar 25, 2024
1 parent dbd4cec commit 447c008
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/block-editor/src/components/block-switcher/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit 447c008

Please sign in to comment.