-
I see it is possible to control how and if dflex commits drag changes to the DOM via the Could you please elaborate a little bit more on how these 2 options work? I assume I don't understand:
thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Under the hood, DFlex doesn't commit any changes to the DOM. Instead, it utilizes CSS translate indefinitely. This means that even if the dragged element occupies a new position, the DOM order will remain the same and the DOM tree will remain untouched. This ensures optimal performance, as DFlex guarantees zero layout shifts and utilizes CSS within the animated frame. Now, what happens in the case of a migration between two containers? In short, DFlex will maintain the same behavior. Even if the dragged element is positioned within a different parent container, it will still be positioned using CSS translate. The default option is to commit everything to the DOM, including the two scenarios explained above: When dragged within the same container: You have the flexibility to make changes based on the state of your application. With each You can check the interface by importing the option type: import type { DFlexDnDOpts } from "@dflex/dnd"; |
Beta Was this translation helpful? Give feedback.
Under the hood, DFlex doesn't commit any changes to the DOM. Instead, it utilizes CSS translate indefinitely. This means that even if the dragged element occupies a new position, the DOM order will remain the same and the DOM tree will remain untouched. This ensures optimal performance, as DFlex guarantees zero layout shifts and utilizes CSS within the animated frame.
Now, what happens in the case of a migration between two containers?
In short, DFlex will maintain the same behavior. Even if the dragged element is positioned within a different parent container, it will still be positioned using CSS translate.
The default option is to commit everything to the DOM, including the two scenari…