css-element-queries
css-element-queries copied to clipboard
Failed to execute 'removeChild' on 'Node exception on ResizeSensor destructor
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; } };
I see, good catch! Would you mind sending us a pull-request with that fix?
ping @paztis
Is this the same as https://github.com/marcj/css-element-queries/pull/168?