Skip to content

Commit

Permalink
Fix root ID calculation when check if block can be transformed (WordP…
Browse files Browse the repository at this point in the history
…ress#60167)

Co-authored-by: jsnajdr <[email protected]>
Co-authored-by: mcsf <[email protected]>
Co-authored-by: annezazu <[email protected]>
Co-authored-by: youknowriad <[email protected]>
  • Loading branch information
5 people authored 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.