Moveable
    Preparing search index...

    Interface ClippableEvents

    interface ClippableEvents {
        onClip: OnClip;
        onClipEnd: OnClipEnd;
        onClipStart: OnClipStart;
    }
    Index
    onClip: OnClip

    When drag the clip area or controls, the clip event is called.

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

    const moveable = new Moveable(document.body, {
    clippable: true,
    defaultClipPath: "inset",
    customClipPath: "",
    clipRelative: false,
    clipArea: false,
    dragWithClip: true,
    });
    moveable.on("clipStart", e => {
    console.log(e);
    }).on("clip", e => {
    if (e.clipType === "rect") {
    e.target.style.clip = e.clipStyle;
    } else {
    e.target.style.clipPath = e.clipStyle;
    }
    }).on("clipEnd", e => {
    console.log(e);
    });
    onClipEnd: OnClipEnd

    When drag end the clip area or controls, the clipEnd event is called.

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

    const moveable = new Moveable(document.body, {
    clippable: true,
    defaultClipPath: "inset",
    customClipPath: "",
    clipRelative: false,
    clipArea: false,
    dragWithClip: true,
    });
    moveable.on("clipStart", e => {
    console.log(e);
    }).on("clip", e => {
    if (e.clipType === "rect") {
    e.target.style.clip = e.clipStyle;
    } else {
    e.target.style.clipPath = e.clipStyle;
    }
    }).on("clipEnd", e => {
    console.log(e);
    });
    onClipStart: OnClipStart

    When drag start the clip area or controls, the clipStart event is called.

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

    const moveable = new Moveable(document.body, {
    clippable: true,
    defaultClipPath: "inset",
    customClipPath: "",
    clipRelative: false,
    clipArea: false,
    dragWithClip: true,
    });
    moveable.on("clipStart", e => {
    console.log(e);
    }).on("clip", e => {
    if (e.clipType === "rect") {
    e.target.style.clip = e.clipStyle;
    } else {
    e.target.style.clipPath = e.clipStyle;
    }
    }).on("clipEnd", e => {
    console.log(e);
    });