Skip to content

Commit

Permalink
useOnBlockDrop: Fix TypeError via array coercion
Browse files Browse the repository at this point in the history
Fixes #58653
  • Loading branch information
mcsf committed Feb 5, 2024
1 parent 9cf0fc0 commit 44950c8
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ export default function useOnBlockDrop(
initialPosition = 0,
clientIdsToReplace = []
) => {
if ( ! Array.isArray( blocks ) ) blocks = [ blocks ];

const clientIds = getBlockOrder( targetRootClientId );
const clientId = clientIds[ targetBlockIndex ];
const blocksClientIds = blocks.map( ( block ) => block.clientId );
Expand Down

0 comments on commit 44950c8

Please sign in to comment.