Creates a ghost element from the dragged element.
The element being dragged
The drag event containing position information
Optionaloptions: CreateGhostOptionsOptional configuration. See CreateGhostOptions.
When omitted, the ghost is appended to document.body with no
fallback class and zero offset (the pre-PR2 default).
The created ghost element
Creates a stacked ghost for multi-item drag. Shows the anchor item with a count badge and stacked shadow effect.
Optionaloptions: CreateGhostOptionsCreates a placeholder element to show where the item will be dropped.
The placeholder is a semi-transparent CLONE of the dragged element —
legacy-SortableJS parity, where the in-list drop indicator is the item
itself wearing ghostClass. A bare gray box (the previous behaviour)
reads as a rendering glitch next to rich item content like thumbnails.
Element to base the placeholder on
Optionaloptions: { dataIdAttr?: string }dataIdAttr names the identity attribute to strip
The created placeholder element
Updates the position of the ghost element
Mouse X position
Mouse Y position
Shows or updates the placeholder at the specified position
The container element
Insert placeholder before this element (null = append)
Removes the ghost element and cleans up
OptionaldraggedElement: HTMLElementOriginal dragged element to remove classes from
Removes the placeholder element
Cleans up all ghost-related elements
OptionaldraggedElement: HTMLElementOriginal dragged element to remove classes from
Gets the current ghost element
Gets the current placeholder element
Gets the chosen class name
Gets the drag class name
GhostManager handles the creation and management of ghost elements during drag operations. The ghost element is a visual clone that follows the cursor during dragging.