diff --git a/src/utils/dnd-manager.js b/src/utils/dnd-manager.js index 6adb8dca..bc8fdd14 100644 --- a/src/utils/dnd-manager.js +++ b/src/utils/dnd-manager.js @@ -235,9 +235,14 @@ export default class DndManager { // throttle `dragHover` work to available animation frames cancelAnimationFrame(this.rafId); this.rafId = requestAnimationFrame(() => { + const item = monitor.getItem() + // skip if drag already ended before the animation frame + if (!item || !monitor.isOver()) { + return; + } this.dragHover({ node: draggedNode, - path: monitor.getItem().path, + path: item.path, minimumTreeIndex: dropTargetProps.listIndex, depth: targetDepth, });