0

When using React Draggable, normally you click and hold down the button to select and drag an item with the mouse. Is there a way to just click an item and release the mouse button, and that item attaches the cursor and you are able to drag it around that way? I am using react-xarrows and trying to select an endpoint to drag by click-and-release.

I tried preventing the mouseup event, stopimmediatepropagation on mouseup event, but that isn't working.

clickCoa.addEventListener('mouseup', function(e){
    console.log('mouseup');
    e.preventDefault()
    e.stopImmediatePropagation()
    return false;
});
1
  • it looks like drag-and-drop libraries use browser functionalities to display the node which is moving with the mouse or touch : developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/… then you cannot use theses libraries to do your effect on click. moreover you will have to develop yourself the display of the node moving with the cursor.
    – mmm
    Commented 17 hours ago

0