Draw line when dragging element?

700 Views Asked by At

Is it possible to draw line between the container and a draggable element during dragging using 'dragula' lib? When the element is dropped, the line should disappear.

1

There are 1 best solutions below

0
On BEST ANSWER
<div [dragula]='"my-bag"'>
    <div class="draggable-item">
        <div class="my-drag-indicator">
            // style your line here
        </div>
        <div class="my-drag-content">
            // your content here
        </div>
    </div>
</div>

while dragging, you will have a clone image of your item, dragula will add 'gu-transit' class to it. As the structure above, you can style your .draggable-item.gu-transit to hide the '.my-drag-content' and show the 'my-drag-indicator'