Is it possible to prevent SortableJS from moving the HTMLElement? #2138
-
Apologies if I've missed this in the documentation, but I'm trying figure out if it is possible to configure SortableJS to not actually move the HTMLElement being dragged. Specifically, I'd like to receive the relevant data about where an element is being dragged to and when it is dropped, but I would like to leverage my templating engine to actually re-order the HTMLElement instances by making state mutations that reflect the drag + drop actions. Is this possible? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes it's possible using the onMove option. It gives you all relevant information about where the element being dragged over, and if you |
Beta Was this translation helpful? Give feedback.
Yes it's possible using the onMove option. It gives you all relevant information about where the element being dragged over, and if you
return false;
in that function, the dragged element will not actually be moved.Unfortunately this will mean the user won't see it moving in the list in real-time (because sortable actually moves the element when doing this).