Moveable
    Preparing search index...

    Interface ClickableProps

    interface ClickableProps {
        clickable?: boolean;
        onClick?: (e: OnClick) => any;
        onClickGroup?: (e: OnClickGroup) => any;
    }

    Hierarchy (View Summary)

    Index
    clickable?: boolean

    Whether to trigger the moveable's click event.

    true
    
    onClick?: (e: OnClick) => any

    When you click on the element, the click event is called.

    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    target: document.querySelector(".target"),
    });
    moveable.on("click", ({ hasTarget, containsTarget, targetIndex }) => {
    // If you click on an element other than the target and not included in the target, index is -1.
    console.log("onClickGroup", target, hasTarget, containsTarget, targetIndex);
    });
    onClickGroup?: (e: OnClickGroup) => any

    When you click on the element inside the group, the clickGroup event is called.

    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    target: [].slice.call(document.querySelectorAll(".target")),
    });
    moveable.on("clickGroup", ({ inputTarget, isTarget, containsTarget, targetIndex }) => {
    // If you click on an element other than the target and not included in the target, index is -1.
    console.log("onClickGroup", inputTarget, isTarget, containsTarget, targetIndex);
    });