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 committed Feb 5, 2024
1 parent d79a464 commit 8c24f68
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 8c24f68

Please sign in to comment.