bevacqua / dragula

:ok_hand: Drag and drop so simple it hurts
https://bevacqua.github.io/dragula/
MIT License
22.01k stars 1.97k forks source link

Is there a way to get the current dragged element? #629

Closed directcuteo closed 4 years ago

directcuteo commented 4 years ago

Hi! I would like to get the sourceModel and the sourceIndex of the current element being dragged but on the drag start action. There is a dropModel Observable which has these values but it is fired on drop event. Is there any way to get them on drag event?

I noticed the removeModel which provides these values but even if the element is being removed from the list on dragStart, this event is not fired. It gets fired when a element is spilled out from a list.

Can I achieve this in some way or maybe a change to be implemented to fire some event with these values on the drag start? It would be extremely useful!

Thank you a lot!!

dcantatore commented 4 years ago

https://github.com/bevacqua/dragula#drakeon-events

On drag