Back to Docs
Interaction

drag

Drag an element from one position to another. Simulates mousedown, mousemove steps, and mouseup.

Usage

$ cdpilot drag <from-selector> <to-selector>

Arguments

NameRequiredDescription
from-selectorrequiredCSS selector of the element to drag
to-selectorrequiredCSS selector of the drop target

Examples

Drag an item into a drop zone

$ npx cdpilot drag ".item-1" ".dropzone"