Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Uncaught Invariant Violation: Expected to find a valid target." after cancelling a drag into the react sortable tree #490

Open
mx2323 opened this issue May 31, 2019 · 16 comments

Comments

@mx2323
Copy link

mx2323 commented May 31, 2019

I discovered this issue while integrating react-sortable-tree into my app, but was able to easily reproduce with one of the examples in the storybook.

https://codesandbox.io/s/xzoq6xprlz

Drag the "baby rabbit" box to the React Sortable Tree area, move it around so that it registers with the React Sortable Tree, then move the box out of the React Sortable Tree area such that the placeholder turns red, then release the box outside of the React Sortable Tree area.

Screen Shot 2019-05-31 at 1 12 04 PM

This will cause the Console to fire with this error.


**browser.js:38 Uncaught Invariant Violation: Expected to find a valid target.
    at invariant (https://xzoq6xprlz.codesandbox.io/node_modules/invariant/browser.js:38:15)
    at DragDropMonitorImpl.canDropOnTarget (https://xzoq6xprlz.codesandbox.io/node_modules/dnd-core/lib/cjs/DragDropMonitorImpl.js:67:9)**
    at DropTargetMonitorImpl.canDrop (https://xzoq6xprlz.codesandbox.io/node_modules/react-dnd/lib/cjs/DropTargetMonitorImpl.js:24:41)
    at nodeDropTargetPropInjection (https://xzoq6xprlz.codesandbox.io/node_modules/react-sortable-tree/dist/index.cjs.js:2367:28)
    at DragDropContainer.getCurrentState (https://xzoq6xprlz.codesandbox.io/node_modules/react-dnd/lib/cjs/decorateHandler.js:116:29)
    at DragDropContainer._this.handleChange (https://xzoq6xprlz.codesandbox.io/node_modules/react-dnd/lib/cjs/decorateHandler.js:45:39)
    at handleChange (https://xzoq6xprlz.codesandbox.io/node_modules/dnd-core/lib/cjs/DragDropMonitorImpl.js:27:21)
    at dispatch (https://xzoq6xprlz.codesandbox.io/node_modules/redux/lib/redux.js:220:7)
    at Object.eval [as endDrag] (https://xzoq6xprlz.codesandbox.io/node_modules/dnd-core/lib/cjs/DragDropManagerImpl.js:67:21)
    at HTML5Backend.handleTopDragEndCapture (https://xzoq6xprlz.codesandbox.io/node_modules/react-dnd-html5-backend/lib/cjs/HTML5Backend.js:145:31)
@bexoss
Copy link

bexoss commented Jun 10, 2019

+1

@mx2323
Copy link
Author

mx2323 commented Jun 13, 2019

was able to make a small fix in react-dnd
react-dnd/react-dnd#1368

@baddlan
Copy link

baddlan commented Dec 2, 2019

+1

@weirDozzz
Copy link
Contributor

#740 hope this problem can be solved

@lewishornsby
Copy link

Is this fixed yet? I really don't want to have to patch a lib :(

@webspin
Copy link

webspin commented Nov 2, 2020

+1

@sinanyaman95
Copy link

Is this fixed yet?

@mepaJanitza
Copy link

it seems to be fixed

@adkaushik
Copy link

Not fixed yet I guess. Still getting this error

@samhatoum
Copy link

+1

@jemliF
Copy link

jemliF commented Mar 14, 2021

Not fixed yet

@absolutelysimon
Copy link

Still not fixed. I'd be happy to write a PR to patch it, but I don't know enough about React-DnD to know where that patch would go.

@karibertils
Copy link

+1 Also getting this

@NickEmpetvee
Copy link

+1

2 similar comments
@MichalMajeranTZMO
Copy link

MichalMajeranTZMO commented Mar 22, 2022

+1

@jevy-wangfei
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests