Describe the bug
Uncaught Error: Expected to find a valid target.
Similar to #361, but in a different scenario.
I am using nested sources and targets. I have a list of items (each item being both a drag source and a drag target of type 'item'), with each item having a number of subitems (each subitem being both a drag source and a drag target of type 'subitem').
When swapping a dragged subitem with a hovered subitem within the same item, everything works as expected.
To Reproduce
When swapping a dragged subitem with a hovered subitem of a different item, the following error occurs:
Uncaught Error: Expected to find a valid target.
at invariant (browser.js:38)
at DragDropMonitorImpl../node_modules/dnd-core/lib/DragDropMonitorImpl.js.DragDropMonitorImpl.canDropOnTarget (DragDropMonitorImpl.js:60)
at HTML5Backend.js:428
at Array.some ()
at HTML5Backend../node_modules/react-dnd-html5-backend/lib/HTML5Backend.js.HTML5Backend.handleTopDragOver (HTML5Backend.js:427)
Expected behavior
The swap occurs without the error.
Desktop:
- OS: macOS High Sierra @ 10.13.5
- Browser: Chrome @ 68.0.3440.106 (Official Build) (64-bit)
- react@16.4.2
- react-dnd@5.0.0
- react-dnd-html5-backend@5.0.1
Describe the bug
Uncaught Error: Expected to find a valid target.
Similar to #361, but in a different scenario.
I am using nested sources and targets. I have a list of items (each item being both a drag source and a drag target of type 'item'), with each item having a number of subitems (each subitem being both a drag source and a drag target of type 'subitem').
When swapping a dragged subitem with a hovered subitem within the same item, everything works as expected.
To Reproduce
When swapping a dragged subitem with a hovered subitem of a different item, the following error occurs:
Uncaught Error: Expected to find a valid target.
at invariant (browser.js:38)
at DragDropMonitorImpl../node_modules/dnd-core/lib/DragDropMonitorImpl.js.DragDropMonitorImpl.canDropOnTarget (DragDropMonitorImpl.js:60)
at HTML5Backend.js:428
at Array.some ()
at HTML5Backend../node_modules/react-dnd-html5-backend/lib/HTML5Backend.js.HTML5Backend.handleTopDragOver (HTML5Backend.js:427)
Expected behavior
The swap occurs without the error.
Desktop: