Interface SortableConfig

interface SortableConfig {
    items?: Element[];
    mode?: "swap" | "move";
}

Properties

Properties

items?: Element[]

The elements that will be used as the draggable items.

The widget should have more than one draggable item.

If this is not specified, then

  1. The top-level element that constitutes the widget is searched for any elements that contain the class lisn-sortable-item. They do not have to be immediate children of the root element.
  2. If there are no such elements, all of the immediate children of the widget element (other than script and style elements) are taken as the items.
mode?: "swap" | "move"

Whether to move the dragged item to before/after the drop target, or swap it with the drop target.

Note that the moving/swapping action is being done as the user is dragging as soon as they drag over another item, so in order to achieve a swap effect, the user needs to be able to drag an item from one location to another without the path of the mouse crossing over all in-between items.

"move";