Coder Social home page Coder Social logo

Comments (3)

brayunm avatar brayunm commented on August 30, 2024 1

Thanks for the quick response.

I've implemented the polyfill you've suggested and its working as expected.

from ngx-drag-drop.

reppners avatar reppners commented on August 30, 2024

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.

from ngx-drag-drop.

reppners avatar reppners commented on August 30, 2024

Will close this one because workaround/polyfill is available and there are issues that prevent using ng-template when nesting drop zones.

from ngx-drag-drop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.