weasel API - v0.8.0
    Preparing search index...

    Interface UseHandleDragOptions<T>

    Options for useHandleDrag.

    interface UseHandleDragOptions<T extends HTMLElement | SVGElement> {
        getRect?: (target: T) => Element;
        onEnd?: (e: PointerEvent) => void;
        onMove: (p: HandleDragPoint, e: PointerEvent) => void;
        onStart?: (p: HandleDragPoint, e: PointerEvent<T>) => void;
    }

    Type Parameters

    • T extends HTMLElement | SVGElement
    Index

    Properties

    getRect?: (target: T) => Element

    Element whose getBoundingClientRect() defines the local coordinate space. Defaults to the handle target's owning <svg> if it has one, otherwise the target itself.

    onEnd?: (e: PointerEvent) => void

    Called on pointerup / pointercancel, after listeners are removed.

    onMove: (p: HandleDragPoint, e: PointerEvent) => void

    Called on every pointermove with coords local to the rect element (see getRect).

    onStart?: (p: HandleDragPoint, e: PointerEvent<T>) => void

    Called on pointerdown with the same local coords passed to onMove.