frontend-collective / frontend-collective/react-sortable-tree
Exception: No suitable position found to insert
- Dominant language
- JavaScript
- Stars
- 5k
- Forks
- 914
- PR merge metrics
- No merged PRs in 30d
Description
Hi! I'm encountering an exception using this component. I can reliably reproduce this in my application in a very specific situation but I haven't been able to produce a minimal example so I'm hoping a description helps narrowing this down. It also seems to depend on timing.
The exception is:
```
Error: No suitable position found to insert.
at insertNode (C:\Work\NMM2\node_modules\react-sortable-tree\dist\umd\webpack:\src\utils\tree-data-utils.js:801:15)
at memoizedInsertNode (C:\Work\NMM2\node_modules\react-sortable-tree\dist\umd\webpack:\src\utils\memoized-tree-data-utils.js:35:35)
at ReactSortableTree.value (C:\Work\NMM2\node_modules\react-sortable-tree\dist\umd\webpack:\src\react-sortable-tree.js:244:29)
at Object.hover (C:\Work\NMM2\node_modules\react-sortable-tree\dist\umd\webpack:\src\utils\drag-and-drop-utils.js:130:25)
at Target.hover (C:\Work\NMM2\node_modules\react-dnd\lib\createTargetFactory.js:71:14)
at DragDropManager.hover (C:\Work\NMM2\node_modules\dnd-core\lib\actions\dragDrop.js:139:13)
at Object.hover (C:\Work\NMM2\node_modules\dnd-core\lib\DragDropManager.js:92:38)
at HTML5Backend.handleTopDragOver (C:\Work\NMM2\node_modules\react-dnd-html5-backend\lib\HTML5Backend.js:539:20)
```
What I do is:
- Have a tree with two roots, the first has multiple children, the second only one.
- Expand the second root
- Quickly drag the second root element across its sole child and outside the tree div. The exception happens before I release the mouse button.
It may be noteworthy that by the time the exception happens the "canDrop" callback has never been invoked.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.