From 1e822856332179c89f991c7e3761f98704157c34 Mon Sep 17 00:00:00 2001 From: Daniel Richards Date: Thu, 16 Jul 2020 21:33:59 +0800 Subject: [PATCH] Fix blocks dropping incorrectly in nested blocks (#23950) --- .../block-editor/src/components/use-block-drop-zone/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/use-block-drop-zone/index.js b/packages/block-editor/src/components/use-block-drop-zone/index.js index 579cd5dc93a0af..de2368d333ca31 100644 --- a/packages/block-editor/src/components/use-block-drop-zone/index.js +++ b/packages/block-editor/src/components/use-block-drop-zone/index.js @@ -260,7 +260,10 @@ export default function useBlockDropZone( { return; } - const sourceBlockIndex = getBlockIndex( sourceClientIds[ 0 ] ); + const sourceBlockIndex = getBlockIndex( + sourceClientIds[ 0 ], + sourceRootClientId + ); // If the user is dropping to the same position, return early. if (