Skip to content

Commit d1ae0eb

Browse files
committed
fix: External node offset was shifted
1 parent 2fe6251 commit d1ae0eb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Diff for: src/utils/drag-and-drop-utils.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,8 @@ function getTargetDepth(dropTargetProps, monitor, component) {
5252
const relativePosition = findDOMNode(component).getBoundingClientRect(); // eslint-disable-line react/no-find-dom-node
5353
const leftShift =
5454
monitor.getSourceClientOffset().x - relativePosition.left;
55-
blocksOffset = Math.round(
56-
leftShift / dropTargetProps.scaffoldBlockPxWidth
57-
);
55+
blocksOffset =
56+
Math.round(leftShift / dropTargetProps.scaffoldBlockPxWidth) - 1;
5857
} else {
5958
blocksOffset = dropTargetProps.path.length;
6059
}

0 commit comments

Comments
 (0)