vue-dndrop
vue-dndrop copied to clipboard
options to prevent native link dragging?
the element get stuck and start following the mouse, I have to right-click for it to drop in place, which is very annoying. any way to fix this besides adding custom CSS?
a {
-webkit-user-drag: none;
user-select: none;
}
@lmssieh can you show me a snippet of your code? and maybe a gif of the behaviour

you can reproduce this bug easily, just add a link inside Draggble then hover over the link and drag.
@lmssieh i have tried this scenarios, and I think yours is the first one. You can try out the others and see if it still happens.
tag="a"inside theContainer. This is where your error can be reproduced, you can easily see that when you hover any child, all the children are selected. They all share the same ref, that's why you cannot select, move and expect the proper behaviour. Wrong solution ❌
<Container
:get-ghost-parent="getGhostParent"
:get-child-payload="getChildPayload"
tag="a"
@drop="onDrop"
@drop-ready="onDropReady"
@drop-not-allowed="dropNotAllowed">
<Draggable v-for="item in items" :key="item.id">
<div class="draggable-item">
{{ item.data }}
</div>
</Draggable>
</Container>
atag as for the child of theDraggableelement. Acceptable solution ✅
<Draggable v-for="item in items" :key="item.id">
<a class="draggable-item">
{{ item.data }}
</a>
</Draggable>
tag="a"for theDraggableelement: Acceptable solution ✅
<Draggable v-for="item in items" :key="item.id" tag="a">
<div class="draggable-item">
{{ item.data }}
</div>
</Draggable>