DropListRef
Reference to a drop list. Used to manipulate or dispose of the container.
constructor
DropListRef<T>element
anyElement that the drop list is attached to.
disabled
booleanWhether starting a dragging sequence from this container is disabled.
sortingDisabled
booleanWhether sorting items within the list is disabled.
lockAxis
"x" | "y"Locks the position of the draggable elements inside the container along the specified axis.
autoScrollDisabled
booleanWhether auto-scrolling the view when the user moves their pointer close to the edges is disabled.
autoScrollStep
numberNumber of pixels to scroll for each frame when auto-scrolling an element.
enterPredicate
(drag: DragRef<any>, drop: DropListRef<any>) => booleanFunction that is used to determine whether an item is allowed to be moved into a drop container.
sortPredicate
(index: number, drag: DragRef<any>, drop: DropListRef<any>) => booleanFunction that is used to determine whether an item can be sorted into a particular index.
beforeStarted
anyEmits right before dragging has started.
entered
anyEmits when the user has moved a new drag item into this container.
exited
anyEmits when the user removes an item from the container by dragging it into another container.
dropped
anyEmits when the user drops an item inside the container.
sorted
anyEmits as the user is swapping items while actively dragging.
receivingStarted
anyEmits when a dragging sequence is started in a list connected to the current one.
receivingStopped
anyEmits when a dragging sequence is stopped from a list connected to the current one.
data
TArbitrary data that can be attached to the drop list.
dispose
voidRemoves the drop list functionality from the DOM element.
voidisDragging
booleanWhether an item from this list is currently being dragged.
booleanstart
voidStarts dragging an item.
voidenter
voidAttempts to move an item into the container.
numberPosition of the item along the X axis.
numberPosition of the item along the Y axis.
number | undefinedIndex at which the item entered. If omitted, the container will try to figure it out automatically.
voidexit
voidRemoves an item from the container after it was dragged into another container by the user.
voiddrop
voidDrops an item into this container.
numberIndex at which the item should be inserted.
numberIndex of the item when dragging started.
booleanWhether the user's pointer was over the container when the item was dropped.
MouseEvent | TouchEventEvent that triggered the dropping sequence.
voidwithItems
thisSets the draggable items that are a part of this list.
thiswithDirection
thisSets the layout direction of the drop list.
DirectionthisconnectedTo
thisSets the containers that are connected to this one. When two or more containers are connected, the user will be allowed to transfer items between them.
DropListRef<any>[]Other containers that the current containers should be connected to.
thiswithOrientation
thisSets the orientation of the container.
thiswithScrollableParents
thisSets which parent elements are can be scrolled while the user is dragging.
HTMLElement[]Elements that can be scrolled.
thiswithElementContainer
thisConfigures the drop list so that a different element is used as the container for the dragged items. This is useful for the cases when one might not have control over the full DOM that sets up the dragging. Note that the alternate container needs to be a descendant of the drop list.
HTMLElementNew element container to be assigned.
thisgetScrollableParents
readonly HTMLElement[]Gets the scrollable parents that are registered with this drop container.
readonly HTMLElement[]getItemIndex
numberFigures out the index of an item in the container.
numberisReceiving
booleanWhether the list is able to receive the item that is currently being dragged inside a connected drop list.
boolean