I'd like to be able to detect when a user drags a file into the window and pop up an overlay over the whole app that shows the various folders the user could upload the file to.
So far, I understand that I can listen to the window for "dragenter" and show my overlay, and listen to the overlay for "dragleave" to hide it, but the problem seems to be that dragging over the drop zones causes the overlay's dragleave event to fire, which makes the overlay hide (which makes the window dragenter event show the overlay, and so on).
I'm using Dropzone.js for my folder dropzones. I've looked around and seen similar problems to mine, but none that solved this problem.
Edit: I found a solution (of sorts) elsewhere on StackOverflow: jQuery Drag-and-Drop Flickering on Hover (Webkit only)
The solution is to check the event on dragleave and, if the pageX and pageY are both 0, then it means the dragleave was because the user left the window, rather than dragged over one of the dropzones.