Vue.draggable: Dragging Item trigger only on certain area

Created on 8 Apr 2017  路  4Comments  路  Source: SortableJS/Vue.Draggable

I just wanted to know if it's possible to trigger the drag event just in a certain area in the list item. Cause if the list is 100% of the width of a touch screen it's getting hard to scroll.

question

Most helpful comment

worked out thanks. just added and works fine.

<draggable v-model="myArray" :options="{handle:'.area'}" @start="drag=true" @end="drag=false">
   <div v-for="element in myArray">{{element.name}}</div>
</draggable>

All 4 comments

See option "handle" for sortable https://github.com/RubaXa/Sortable#options

worked out thanks. just added and works fine.

<draggable v-model="myArray" :options="{handle:'.area'}" @start="drag=true" @end="drag=false">
   <div v-for="element in myArray">{{element.name}}</div>
</draggable>

I want to drag only specific content within div. Is there any way to do this using :options or any other way?
can we pass multiple properties in :options ?

@patpaskoch thanks for the snippet

Was this page helpful?
0 / 5 - 0 ratings

Related issues

clemsontiger picture clemsontiger  路  3Comments

Nrqz picture Nrqz  路  3Comments

mathlet0x picture mathlet0x  路  4Comments

steffanhalv picture steffanhalv  路  3Comments

Kgwkgwkgw picture Kgwkgwkgw  路  3Comments