Closed brayunm closed 6 years ago
Thanks for reporting! Didn't know about missing support of remove()
in IE.
I'm leaning to point people towards applying a polyfill when IE support is needed: https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/remove
// from:https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/remove()/remove().md
(function (arr) {
arr.forEach(function (item) {
if (item.hasOwnProperty('remove')) {
return;
}
Object.defineProperty(item, 'remove', {
configurable: true,
enumerable: true,
writable: true,
value: function remove() {
if (this.parentNode !== null)
this.parentNode.removeChild(this);
}
});
});
})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
The reason being I want to keep the code clean and not include workarounds needed for a single browser that in the future will become obsolete because it's not evergreen.
On the other hand using remove()
is a code smell because its directly operating on the DOM. I'm thinking about refactoring the placeholder to <ng-template>
if possible.
Thanks for the quick response.
I've implemented the polyfill you've suggested and its working as expected.
Will close this one because workaround/polyfill is available and there are issues that prevent using ng-template when nesting drop zones.
Hi,
I've noticed that the remove() method is not supported by IE in version 1.0.0. This is used to hide the placeholder when there's no dragging going on.
https://stackoverflow.com/questions/20428877/javascript-remove-doesnt-work-in-ie As stated in the above stackoverflow I was able to fix this in IE11 by declaring the remove method myself. I'm not sure about older versions though.
Is there any chance this fix (or another one) can be included in a new version?