SortableJS / Sortable

Reorderable drag-and-drop lists for modern browsers and touch devices. No jQuery or framework required.
https://sortablejs.github.io/Sortable/
MIT License
29.78k stars 3.7k forks source link

use `fallbackParent` option instead of `fallbackOnBody` #2245

Open spassvogel opened 1 year ago

spassvogel commented 1 year ago

This PR introduces a new option parameter fallbackParent. It allows you to be more flexible with determining where the fallback ghost element gets appended. You can either pass a DOM node or a function that retrieves the dom node.

Right now you can choose fallbackOnBody and it will use the body, but with this change you have a lot more power in determining what the parent needs to be of the fallback ghost. It's not always feasible to append things to the body.

The fallbackOnBody is still supported, but marked as obsolete and removed from the docs.

IF-tiger commented 4 months ago

More flexibility and Controllable