Vue.draggable: Lock drag list

Created on 1 Feb 2017  路  5Comments  路  Source: SortableJS/Vue.Draggable

Is it possible to "lock" a drag list after some operation?

It will be useful from example if I have two lists (A and B) and I drop elements for B to A until A contains "10" elements, after that "lock" list B for no more drop elements on A.

UPDATE: I found a solution using :move function

question

Most helpful comment

That the 'put, 'pull' option of group should be usefull

All 5 comments

Use disabled property on the option props. It is reactive so you can change it when you want

YES! The problem is not disabling at all the DnD function, but only on B pushing on A, because I want to leave the possibility to push back an element from A to B

That the 'put, 'pull' option of group should be usefull

I used the :move property

<draggable :list="listB" :move="checkMove">

checkMove () {
if (this.listA.length > 9) return false
},

and It works perfectly!

Yes, another possibility :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Leadaxe picture Leadaxe  路  3Comments

rootman picture rootman  路  3Comments

fedenko picture fedenko  路  3Comments

karam94 picture karam94  路  3Comments

AlexandreBonneau picture AlexandreBonneau  路  3Comments