diff --git a/src/utils/dnd-manager.js b/src/utils/dnd-manager.js index 1a88af4e..38349a22 100644 --- a/src/utils/dnd-manager.js +++ b/src/utils/dnd-manager.js @@ -104,9 +104,9 @@ export default class DndManager { const draggedNode = monitor.getItem().node; const draggedChildDepth = getDepth(draggedNode); - targetDepth = Math.min( - targetDepth, - this.maxDepth - draggedChildDepth - 1 + targetDepth = Math.max( + 0, + Math.min(targetDepth, this.maxDepth - draggedChildDepth - 1) ); }