After trying a bit myself, I came to the answer.
pass draggable
to enable drag events on the element, and to disable animation prevent default on onDragStart.
will leave the answer here if anyone will also need it.
<div
onDragStart={(e) => {
console.log("onDragStart") // do what you need here
e.preventDefault(); // then prevent animation
}}
draggable
>
someContent
</div>
EDIT
this is some advancement but not answers fully answer my question.
what I did is not canceling the animation, but actually canceling animation and all the drag events coming next on the same element. but I need this element to fire on onDrop
event(I did not forget to e.preventDefault() on onDragOver).
i need the onDrop
event to fire. so I can I truly disable animation but let the rest of the drag events fire regularly?
Codesandbox
https://codesandbox.io/s/drag-with-not-animation-b3eh7?file=/src/App.js
come'on guys. you can do it. here's a sample
got it
finally got it.
it is possible to disable animation by passing empty image to the draged element, by using DataTransfer.setDragImage() function.
const emptyImg = new Image();
<div
onDragStart={(e) => e.dataTransfer.setDragImage(emptyImg, 0, 0)}
draggable
>
someContent
</div>
EDIT: NO
I still need help here.
you can turn off the animation, but the behavior would still be as a draggable element.
I just need to turn on drag Event but without enable the draggable browser behavior for the element.
help!