Skip to content

Commit

Permalink
Test Cases: Fix failing test cases by checking for sameParent instead…
Browse files Browse the repository at this point in the history
… of differentParent
  • Loading branch information
yogeshbhutkar committed Jan 7, 2025
1 parent 3d84e6e commit e250dfb
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -394,19 +394,18 @@ export function getListViewDropTarget(
);

// Skip sibling insertion check if block is moving within same parent.
const hasDifferentParent = draggedBlocksData?.some(
( draggedBlock ) =>
! candidateBlockParents?.find(
( blockData ) =>
blockData.clientId === draggedBlock.rootClientId &&
blockData.nestingLevel === draggedBlock.nestingLevel - 1
)
const hasSameParent = draggedBlocksData?.some( ( draggedBlock ) =>
candidateBlockParents?.find(
( blockData ) =>
blockData.clientId === draggedBlock.rootClientId &&
blockData.nestingLevel === draggedBlock.nestingLevel - 1
)
);

// If dropping as a sibling, but block cannot be inserted in
// this context, return early.
if (
hasDifferentParent &&
! hasSameParent &&
! candidateBlockData.canInsertDraggedBlocksAsSibling
) {
return;
Expand Down

0 comments on commit e250dfb

Please sign in to comment.