In one of our apps we were consistently getting two dragenter events but only one dragleave event. This would cause the dropzone to be stuck in the active state. I coun't identify the cuase of the double events, I imagine it is somehow related to layout since another app we have seems to be working fine with seemingly identical components, just differences in how they are laid out / styled.
What this commit does is instead of tracking the number of times a dragenter event occurs (once or twice), it instead sets a _dragInProgress flag on the first dragenter event. Any further dragenter events are discarded until a dragleave event cancels the drag.
This fixes our app and seems to work in all the browsers I tested. (chrome and firefox).
In one of our apps we were consistently getting two
dragenter
events but only onedragleave
event. This would cause the dropzone to be stuck in the active state. I coun't identify the cuase of the double events, I imagine it is somehow related to layout since another app we have seems to be working fine with seemingly identical components, just differences in how they are laid out / styled.What this commit does is instead of tracking the number of times a
dragenter
event occurs (once or twice), it instead sets a_dragInProgress
flag on the firstdragenter
event. Any furtherdragenter
events are discarded until adragleave
event cancels the drag.This fixes our app and seems to work in all the browsers I tested. (chrome and firefox).