Skip to content

Commit

Permalink
Set correct destination index
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed Oct 18, 2024
1 parent d91f853 commit cdc6f6b
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,16 @@ function useInsertionPoint( {

if ( sectionRootClientId === selectedBlockClientId ) {
_destinationRootClientId = sectionRootClientId;
_destinationIndex = getBlockOrder(
_destinationRootClientId
).length;
} else {
_destinationRootClientId = getBlockRootClientId(
selectedBlockClientId
);
_destinationIndex =
getBlockIndex( selectedBlockClientId ) + 1;
}

_destinationIndex = getBlockIndex( selectedBlockClientId ) + 1;
} else {
// Insert at the end of the list.
_destinationIndex = getBlockOrder(
Expand Down

0 comments on commit cdc6f6b

Please sign in to comment.