Skip to content
This repository was archived by the owner on Sep 19, 2024. It is now read-only.

Commit a45f490

Browse files
fixed issue with canDrop not returning correct nextParent
1 parent 6cf2290 commit a45f490

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/utils/dnd-manager.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -183,23 +183,15 @@ const canDrop = (
183183

184184
if (typeof treeRefcanDrop === 'function') {
185185
const { node } = monitor.getItem()
186-
const addedResult = memoizedInsertNode({
187-
treeData: draggingTreeData || treeReftreeData,
188-
newNode: node,
189-
depth: targetDepth,
190-
getNodeKey,
191-
minimumTreeIndex: dropTargetProps.listIndex,
192-
expandParent: true,
193-
})
194186

195187
return treeRefcanDrop({
196188
node,
197189
prevPath: monitor.getItem().path,
198190
prevParent: monitor.getItem().parentNode,
199191
prevTreeIndex: monitor.getItem().treeIndex, // Equals -1 when dragged from external tree
200-
nextPath: addedResult.path,
201-
nextParent: addedResult.parentNode,
202-
nextTreeIndex: addedResult.treeIndex,
192+
nextPath: dropTargetProps.children.props.path,
193+
nextParent: dropTargetProps.children.props.parentNode,
194+
nextTreeIndex: dropTargetProps.children.props.treeIndex,
203195
})
204196
}
205197

0 commit comments

Comments
 (0)