I was working on some drag/drop functionality and was attaching events through the standard Backbone way:
events: { 
 'dragenter': 'dragEnter',
 'dragend': 'dragEnd'
 ....,
 .....
}
I noticed in my function that the event object that is passed into it doesn't contain some properties outlined in the html5 spec.
Specifically, the dataTransfer obj is missing. 
I created a quick demo to demonstrate my issue. Just drag a file or something over it to see it in the logs.
My question is why does this happen? I have looked through the documentation and can't seem to find it.
If you're using Backbone Events, Backbone puts a layer on top of the actual event. If you want to access the original event you'll have to use: event.originalEvent.
In the originalEvent you'll find dataTransfer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With