css-element-queries icon indicating copy to clipboard operation
css-element-queries copied to clipboard

Failed to execute 'removeChild' on 'Node exception on ResizeSensor destructor

Open paztis opened this issue 10 years ago • 3 comments
trafficstars

In ResizeSensor destructor, sometimes there's an exception "Failed to execute 'removeChild' on 'Node': The node to be removed is no longer a child of this node" This is due to an element.resizeSensor already removed from element.

Here's a patch to correct this:

this.ResizeSensor.detach = function(element) { if (element.resizeSensor) { if(element.resizeSensor.parentNode) { element.resizeSensor.parentNode.removeChild(element.resizeSensor); } //old removechild call //element.removeChild(element.resizeSensor); delete element.resizeSensor; delete element.resizedAttached; } };

paztis avatar Nov 09 '15 12:11 paztis

I see, good catch! Would you mind sending us a pull-request with that fix?

marcj avatar Nov 24 '15 23:11 marcj

ping @paztis

marcj avatar Mar 11 '16 10:03 marcj

Is this the same as https://github.com/marcj/css-element-queries/pull/168?

eduardomoroni avatar Feb 25 '19 10:02 eduardomoroni