Skip to content

Commit 52f0bcf

Browse files
weirDozzzliangzenan
and
liangzenan
authored
fix: "Uncaught Invariant Violation: Expected to find a valid target." after cancelling a drag into the react sortable tree (frontend-collective#740)
Co-authored-by: liangzenan <[email protected]>
1 parent 3c29cbf commit 52f0bcf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/react-sortable-tree.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ class ReactSortableTree extends Component {
230230
// it means that the drag was canceled or the dragSource dropped
231231
// elsewhere, and we should reset the state of this tree
232232
if (!monitor.isDragging() && this.state.draggingTreeData) {
233-
this.endDrag();
233+
setTimeout(() => {this.endDrag()});
234234
}
235235
}
236236

0 commit comments

Comments
 (0)