Vue.draggable: put option seems not work

Created on 3 Dec 2018  路  11Comments  路  Source: SortableJS/Vue.Draggable

here is my example

Step by step scenario

i am trying to implement this feature: i can only drag elements from list1 to list2, other drag options锛坉rag element from list2 to list1 or list1 reordered) will be disabled.

Actual Solution

I noticed that this component supports sortable.js, so i read its documenation and used group option in option object, but it turns that i can only use pull option, and wether i use put option, i can't disable any list to reorder,and i even copy the source code in sortable's official site. i wonder if i missed something?

Expected Solution

Most helpful comment

@flyinglove @i5heu You are using the same group name, so it will be allowed no matter what you set pull and put to. The behavior you want will happen if you give a different group name to each one or no group name at all. Also, you need to use the latest Sortable (1.8.0-rc1).

Example: https://jsfiddle.net/tL79vnem/

If you want a list to not be reorderable, set sort: false.

All 11 comments

in the end i used move event solve this, but it would be much easier if put option can work

Could you create a jsfiddle?

I am not sure to understand of what is the problem with the current example.

I am not sure to understand of what is the problem with the current example
here is the example https://jsfiddle.net/my_sunshine/chf7521n/10/, this is the demo

What is the scenario? the observerd result vs the expoected result?

What is the scenario? the observerd result vs the expoected result?

i hope i can only drag element from list1 to list2, other drag movements will be disabled, even list1 reordering is disabled too.
But in this demo, i can reorder list1

For me this error exist too.

@flyinglove @i5heu You are using the same group name, so it will be allowed no matter what you set pull and put to. The behavior you want will happen if you give a different group name to each one or no group name at all. Also, you need to use the latest Sortable (1.8.0-rc1).

Example: https://jsfiddle.net/tL79vnem/

If you want a list to not be reorderable, set sort: false.

@flyinglove @i5heu You are using the same group name, so it will be allowed no matter what you set pull and put to. The behavior you want will happen if you give a different group name to each one or no group name at all. Also, you need to use the latest Sortable (1.8.0-rc1).

Example: https://jsfiddle.net/tL79vnem/

If you want a list to not be reorderable, set sort: false.

thanks a lot. i should have noticed that there is a 'stort' option

The behaviour has now changed in 1.8.0: Pull and put will be true by default if it is checking a sortable with the same group, but they can be overridden.

Corrected in version 2.18.0 which is using sortable 1.8.3

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mathlet0x picture mathlet0x  路  4Comments

Kuohao-wu picture Kuohao-wu  路  3Comments

Kgwkgwkgw picture Kgwkgwkgw  路  3Comments

steffanhalv picture steffanhalv  路  3Comments

Sualty picture Sualty  路  3Comments