svg-inline-react icon indicating copy to clipboard operation
svg-inline-react copied to clipboard

'remove' method used in 'getSVGFromSource' is not supported by IE

Open diegocasmo opened this issue 7 years ago • 1 comments

The remove method used by getSVGFromSource when using the raw prop option is not supported by IE (I have tested this with IE 11).

See remove browser compatibility table here: https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/remove

A possible solution might be to check if remove is defined, otherwise use the more broadly supported removeChild as such:

svg.remove ? svg.remove() : svgContainer.removeChild(svg); // deref from parent element

diegocasmo avatar Jul 18 '17 20:07 diegocasmo

@diegocasmo Consider using a polyfill on your end? ChildNode.remove() method in Internet Explorer 9 and higher.

WesleyDRobinson avatar Jul 26 '18 19:07 WesleyDRobinson