I am using a 3rd Party library (angular-draggable-droppable) in an ionic on angular project. As ionic caches pages, the angular component stays in the Dom but with a lower z-index value. It seems that, when having the same page with different z-indexes, the onDrop event is triggered twice, one for each element, as they both are in the dom. My questions are:
Event handlers will be removed and cleaned up when the DOM element is garbage collected as part of the garbage collection process in modern browsers. In your case since ionic caches component instead of removing, you need to manually remove by removeListener
method of javascript.