I have bound dragenter event on an object that contains some children.
$(document).on('dragenter', '#container', function(e) {
console.log('dragenter');
});
When I move with dragged file around them, this event is firing repeatedly. What I have expected is firing dragenter only when entering #container element, not every child too.
Is it proper behavior? How can I prevent it?
You can test whether the element that triggered the event is the container:
Or if you don't have to use event delegation: