Capítulo 191 de 411

Chapter 191: Draggable.addEventListener()

Core Idea

Registers a callback for a Draggable event type; inside the listener, this refers to the Draggable instance that fired it.

Reference Tables

EventFires when
press, clickpointer pressed / released as a click
dragstart, drag, dragenddrag lifecycle
releasepointer released (drag or not)
throwcomplete, throwupdateinertia throw lifecycle (with InertiaPlugin)

Key Takeaways

  1. Prefer passing callbacks directly in the Draggable vars (onDrag, onDragEnd, etc.) for the common case; use addEventListener when attaching listeners dynamically after creation.

Connects To

  • Draggable.create(): where onDrag/onDragEnd/etc. vars-based callbacks are set instead.