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
onDrop not working #770
Comments
Have same issue, with the same version of react-dropzone and Windows 10 (Google Chrome 72.0.3626.119 ). Open method works correctly - onDrop don't launch when You drop file. |
Doing this on react-dropzone.js.org works just fine (the basic example shows the file you dropped). So I'm not sure what you're experiencing. Please provide an example on codesandbox or some other tool. |
@ppi-mzl are you used React DnD? |
We're using React Dnd with react-sortable-tree. |
@darekchynek This problem in React DND react-dnd/react-dnd#457 |
Yes we are using react-dnd and using the fork / nmp Package of @silvainSayduck instead fixes the issue. So this is not a bug in react-dropzone but react-dnd. Maybe this should be mentioned in the documentation since this seems to be a common error. |
Wrapping the Dropzone in a ConnectDropTarget which accepts NativeTypes.FILE works also. |
I'm using |
In case of anyone having an issue that "looks like this one". Sometimes browsers use diferente MIME_TYPE for diferente file types. I had a problem with 'text/csv' mimetype more info, wich did not work on Chrome running on Windows. Took a while to detect the cause. I just wanted to write it here so developers with the same problem I had won't lose time thinking it could be any more complex error. Cheers |
So on my own part, the major issue was this line
I omitted the className On changing to this
It started Working well. Which means the class Pardon my use of single quote where I needed to use a back tick |
Do you want to request a feature or report a bug?
What is the current behavior?
I'm using the example code from the documentation but the onDrop function is never called. The isDragActive, isDragAccept and isDragReject work fine. Using the file selector works too.
Code:
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
Please mention other relevant information such as the browser version, Operating System and react-dropzone version.
The text was updated successfully, but these errors were encountered: