In Chrome target monitor.getItem() returns null in drop handler #6
Description
According to the docs when we call monitor.getItem()
from target drop
handler it must return the object we passed in draggable source beginDrag()
. I've tested it on expamples from website in different browsers (Chrome, IE and Edge):
- stress test: http://gaearon.github.io/react-dnd/examples-dustbin-stress-test.html
- single dustbin: http://gaearon.github.io/react-dnd/examples-dustbin-single-target.html
and I found that everything works fine IE and Edge but does not work in Chrome (Version 46.0.2490.80 m) - getItem
returns null in drop
handler althogh it returns required object in canDrop
and hover
both. Here is an exception that I receive:
Uncaught Error: Invariant Violation: Cannot call endDrag while not dragging.
invariant @ browser.js?9520:42 endDrag @ dragDrop.js?8117:170 (anonymous function) @ DragDropManager.js?26ce:74 endDragIfSourceWasRemovedFromDOM @ HTML5Backend.js?0327:230 handleTopDrop @ HTML5Backend.js?0327:527