Keep an element that is being dragged
I am trying to figure out if there is a way to keep the list element in the 1st Sortable when it is dragged and dropped to the 2nd Sortable. An example would be something like Layoutit!. I know there is https://github.com/RubaXa/Sortable/issues/50 that mentions the ability to clone. But the problem is when I dragover the list element to the 2nd Sortable, the list element on the 1st Sortable is moved to the 2nd Sortable even before I drop the list element, so it gives the impression that the 2nd Sortable can't receive multiple list elements that have same data and that is not true. Where could I modify this behavior so that the list element is not taken from the 1st Sortable? I looked at _onDragStart and _onDragOver but could't understand where you specify the move.
I do not really understand your problem, you described correct behavior.
Create a sample on jsbin.com And describe, how this example should work.
http://jsfiddle.net/48rj8tk5/13/
What I am attempting to do:
- I can drop multiple elements from the First Column to the Second Column. I know I can clone the dragged element back to the First Column, but I would like to prevent the element being moved to the Second Column right away when it is dragged OVER (not DROPPED yet) to the Second Column. The effect that I would like to see is the element on the First Column stay where they are even as the element being dragged over to the Second Column, i.e: layoutit.com
- The First Column can only have the first 3 original elements.
@jrgunawan try dev-branch and use next options:
Sortable.create(first, {
group: { name: "elements", pull: "clone" },
sort: false
});
Sortable.create(second, {
group: { name: "elements", pull: false }
});