what is the event for Vue.Draggable un-choose?

4.4k Views Asked by At

I know there is event for choose but not sure what should I use for un-choose/un-select, for my use case I cannot use @end event.

<draggable :list="list" @choose ="onChoose">

Here is the doc which I am referring.
https://github.com/SortableJS/Vue.Draggable#events

2

There are 2 best solutions below

1
Christopher Fimbel On BEST ANSWER

It would be

<draggable :list="list" @choose ="onChoose" @unchoose="onUnchoose">

From the Vue.Draggable docs

Support for Sortable events:

start, add, remove, update, end, choose, unchoose, sort, filter, clone

0
David Desmaisons On

If you want a specfic item undraggable, use the move prop. Returning false will prevent the item from being draggable:

function onMoveCallback(evt, originalEvent){
   ...
    // return false; — for cancel
}