Skip to content

When detaching, check that node is still a child before attempting to… #116

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

Merged
merged 1 commit into from
Jul 15, 2016

Conversation

aholland
Copy link
Contributor

… remove it.

Background: in my case, the main reason for detaching a listener is because the element has been disrupted (e.g. by having its innerHtml set to "" and being placed in a different parent element) which causes the listener to stop working. In this situation I want to re-register the listener. Before I am able succesfully to do so, I must detach the old listener. But the disruption has already removed the resizeSensor from the element. So when line removeChild throws a "Uncaught NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.". The line I have introduced prevents this in my copy (0.3.2).

@marcj marcj merged commit 812e3bb into marcj:master Jul 15, 2016
@marcj
Copy link
Owner

marcj commented Jul 15, 2016

Good catch, thanks!

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.

2 participants