Sortable
Sortable copied to clipboard
Question: Best way to implement 'drag out to remove/delete'?
In my design the user can delete a list item by dragging it out of the list onto any non-interactive part of the page.
I can't see an easy way to do that. How (for instance) could I adapt one of the demos at https://sortablejs.github.io/Sortable/#simple-list to have that behavior?
The built-in plugin RemoveOnSpill implements this functionality.
TL;DR
import { Sortable, OnSpill } from 'sortablejs/modular/sortable.core.esm';
Sortable.mount(OnSpill);
new Sortable(mylist, {
removeOnSpill: true, // Enable plugin
...
});