vue-smooth-dnd
vue-smooth-dnd copied to clipboard
Is there a convenient way to disable draggables?
Hello Kutlugsahin, et al.
Thank you very much for maintaining the library. Please, is there a convenient way to disable the draggability of items? I'm looking for something like :disabled="yesPleaseDisableMe"
.
Or possibly:
onDragStart: ()=>{
// stop the drag.
}
I need this feature to enable dragging by user, based on permissions. I'm currently using :lock-axis="'undefined'"
and it does prevent a visible drag action, but it still fires the drag events. I'd like to prevent the drag events all together. If such a feature exists, I haven't seen it in the documentation. I would be happy to create a PR to update the docs, if you like.
Thanks again.
I was also looking for something like this, would be nice to add a disabled
prop to completly disable all drag/drop events.
You could specify a drag handle like this:
<Container
drag-handle-selector=".column .header.movable"
>
And then add or remove the movable
class on the column header to enable/disable the dragging.
If you never want to enable it, just choose a selector that doesn't exist.