Skip to main content

PointerDraggable

Function PointerDraggable 

Source
pub fn PointerDraggable<T: Clone + PartialEq + 'static>(
    _: PointerDraggableProps<T>,
) -> Element
Expand description

A draggable that works for mouse and touch/pen.

Mouse drags go through the native HTML5 path (inner core Draggable); touch and pen drags are synthesized from pointer events. Both feed the same context, so your DropZones don’t care which path delivered the payload — touch drops arrive through the zone registry with correct client/element coordinates.

§Props

For details, see the props struct definition.

  • payload : T

    The value delivered on drop.

  • zone : Option<ZoneId>

    The zone this item lives in (reported in DropOutcome::from).

  • effect : DropEffect

    Drop effect. Defaults to Move.

  • disabled : bool

    Disable dragging without unmounting.

  • label : Option<String>

    Label for screen-reader announcements (forwarded to the inner Draggable).

  • threshold : f64

    Movement (px) before a touch counts as a drag rather than a tap.

  • on_drag_start : Option<EventHandler<()>>

    Fired when a drag begins (either path).

  • on_drag_end : Option<EventHandler<bool>>

    Fired when the drag ends; true if a zone consumed the payload.

  • attributes : Vec<Attribute>
  • children : Element