This is rarely used, but you may force the Draggable to begin dragging by calling startDrag()
and passing it the original mouse/touch/pointer event that initiated things - this is necessary because Draggable must inspect that event for various information like pageX, pageY, target, etc. You cannot callstartDrag()
without passing that original event.
startDrag()
is different than enable()
in that enable()
activates the Draggable instance so that it responds to user interaction whereasstartDrag()
actually begins dragging the element, as if the user clicked on it and started dragging.
A great place to learn more about working with mouse/touch/pointer events is https://developers.google.com/web/fundamentals/design-and-ux/input/touch/.