Skip to content

Commit

Permalink
useOnBlockDrop: Fix TypeError via array coercion (#58686)
Browse files Browse the repository at this point in the history
Fixes #58653

Co-authored-by: mcsf <[email protected]>
Co-authored-by: ellatrix <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: mrfoxtalbot <[email protected]>
  • Loading branch information
5 people authored Feb 5, 2024
1 parent f294dd2 commit 9da8121
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 9da8121

Please sign in to comment.