1
4 Comments

DFlex – Alternative to HTML5 Drag and Drop

DFlex is the first and the only library that allows you to drag and drop DOM elements without reconstructing the DOM. It implements transformations to intract with DOM elements even when migrating between containers.
It's work in progress and I'd love to get your feedback :)

submitted this link on May 8, 2022
  1. 1

    How does it compare to react-dnd?

    Can it be used in an iframe?

    1. 1

      I get this question a lot and basically comparing DFlex to any other library is more like comparing React to JQuery.

      DFlex has a totally different approach while all the exciting Drag and Drop libraries follow the exact same approach. Modify the DOM every time the user interacts with any element.

      The traditional implementation kills the benefit of DOM manipulation and totally ignores any type of reconciliation introduced by all modern frameworks.

      All the react/vue/svelte dnd libraries modify the DOM regardless of the framework because until DFlex if you want to drag elements in the list you change its root.

      So the user clicks, you change the DOM. Every interaction means a direct change to the DOM and in most cases cloning the targeted element (that's why the showcases mostly div with text). DFlex doesn't change DOM at all or change the order of the elements instead it transforms the position from one point to another with a tone of other enhancements it has a mechanism that enables interactive DOM.

      Because of transformation you can sense the movement and control it fully. So you get insanely high performance and a rich user experience.

      1. 1

        Can it be used in an iframe?

        1. 1

          I can't see why not but didn't test it with an iframe. If there are any issues I'll be happy to deal with them.

Trending on Indie Hackers
I'm a lawyer who launched an AI contract tool on Product Hunt today — here's what building it as a non-technical founder actually felt like User Avatar 142 comments “This contract looked normal - but could cost millions” User Avatar 54 comments A simple way to keep AI automations from making bad decisions User Avatar 52 comments 👉 The most expensive contract mistakes don’t feel risky User Avatar 41 comments Never hire an SEO Agency for your Saas Startup User Avatar 40 comments The indie maker's dilemma: 2 months in, 700 downloads, and I'm stuck User Avatar 40 comments