Skip to content

Commit

Permalink
fix: External node offset was shifted
Browse files Browse the repository at this point in the history
  • Loading branch information
fritz-c committed Aug 5, 2017
1 parent 2fe6251 commit d1ae0eb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/utils/drag-and-drop-utils.js
Expand Up @@ -52,9 +52,8 @@ function getTargetDepth(dropTargetProps, monitor, component) {
const relativePosition = findDOMNode(component).getBoundingClientRect(); // eslint-disable-line react/no-find-dom-node
const leftShift =
monitor.getSourceClientOffset().x - relativePosition.left;
blocksOffset = Math.round(
leftShift / dropTargetProps.scaffoldBlockPxWidth
);
blocksOffset =
Math.round(leftShift / dropTargetProps.scaffoldBlockPxWidth) - 1;
} else {
blocksOffset = dropTargetProps.path.length;
}
Expand Down

0 comments on commit d1ae0eb

Please sign in to comment.