angular-sortable-view icon indicating copy to clipboard operation
angular-sortable-view copied to clipboard

Remove svElement event listeners on $destroy

Open alejandroiglesias opened this issue 6 years ago • 0 comments
trafficstars

This fixes a Cannot read property 'forEach' of undefined throw that happens if one of the sortable elements has a child with a mouseup event handler that calls Event.stopPropagation(). In that case, the svElement mousedown/touchstart event handler fires, registering the mousemove/touchmove event handler on the documentElement, but there's no mouseup because it was stopped from propagating. This event handler keeps being registered even if the component doesn't exist anymore.

The fix involves de-registering the mousemove/touchmove event handler on the svElement's $destroy event, and it's pretty low-risk.

alejandroiglesias avatar Apr 11 '19 04:04 alejandroiglesias