event.stopPropagation in custom event handlers doesn't work
See original GitHub issueDo you want to request a feature or report a bug?
- I found a bug
- I want to propose a feature
What is the current behavior?
If you have Dropzone which nested into other Dropzone then when you’ll try to upload file to the nested dropzone you’ll also get this file upload to external Dropzone. It should be handled via event.stopPropagation
in then nested Dropzone’s onDrop handler. But event.stopPropagation
doesn’t prevent propagation of event.
If the current behavior is a bug, please provide the steps to reproduce.
- I made a simple demo - you can check it here (https://codepen.io/sumthief/pen/qJqPWO). When you’ll upload to parent area - it’ll console log ‘parent’. But when you’ll upload to child area it’ll console log both ‘children’ and ‘parent’. And it’s not correct behavior because of
stopPropagation
should prevent event propagation.
What is the expected behavior?
event.stopPropagation
should stop propagation of the event. Looks like it was broken in https://github.com/react-dropzone/react-dropzone/pull/616 when invocations of custom handlers were wrapped in Promise
(looks like it’s too late for stopPropagation invocation).
If this is a feature request, what is motivation or use case for changing the behavior?
Please mention other relevant information such as the browser version, Operating System and react-dropzone version. Ubuntu 18.04.1 LTS, Chrome 69.0.3497.100, react-dropzone 5.1.0
Issue Analytics
- State:
- Created 5 years ago
- Comments:14
Top GitHub Comments
🎉 This issue has been resolved in version 6.2.4 🎉
The release is available on:
Your semantic-release bot 📦🚀
@sumthief sorry about that 🙄 Glad it helps though.