Please be aware there is a known issue with images on the Community. We are working to resolve this issue as quickly as possible. We apologize for the inconvenience. If you need urgent help in the meantime, please reach out to technical support or your Threekit representative.

Add drag leave/drop handler to drag tool


1 comment

  • mheskamp

    When using the drag tool, a common use case for us is to take some kind of action when the drag stops based on the final location of the cursor, such as sending the final position or collision detection information back to our application so that we can do things based on that result. It’d be easier to implement if this was built in to the drag tool as opposed to using a disjointed tool such as mouse up and tracking when something is dragging to filter the mouse up events.

    My proposal would be something similar to the following when creating the drag tool with a new handleDrop handler option:

        key: "drag",
        active: true,
        enabled: true,
        handlers: {
            drag: (event: IMouseEvent) => {
                return {
                    handle: (event: IMouseEvent) => { do stuff while dragging },
                    handleDrop: (event: IMouseEvent) => { do something when user stops dragging }

Please sign in to leave a comment.

Powered by Zendesk