Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove svElement event listeners on $destroy #138

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alejandroiglesias
Copy link

@alejandroiglesias alejandroiglesias commented Apr 11, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant