I receive a list of new orders and display them vertically in column A. There is a second column, B, that shows a current prioritized list ordered how individuals want. When I drag an item from column A to column B, it does move the item, which is good. However, it previews correctly but when dropped, the new item ALWAYS goes to the bottom of column B.
I am using this component to get me the drag and drop functionality.
Here is a an example/proof of what I am talking about.
Even once items are in column B and I want to drag and drop them within that column, they preview fine but do not stay when the mouse button is released.
I can fix this inner-sorting issue with the following code (although I believe this should be what the code does without me making changes.):
On the draggable add the following event handler:
v-on:end="end"
And in the JS code, catch the event:
end(e) {
this.prioritizedNewOrders.splice(e.newIndex, 0, this.prioritizedNewOrders.splice(e.oldIndex, 1)[0]);
}
That still does not fix the initial drag into column B though.
ANSWER @sphinx's answer is correct! Here is an updated fiddle with the answer.
Look into Vue-draggable: slot,
So add
slot="footer"
and put it after the default slot, then works fine.