Vue.draggable: How to temp disable dragging?

Created on 28 Oct 2018  路  2Comments  路  Source: SortableJS/Vue.Draggable

My app allows you to edit the draggable list item text. With dragging enabled, the user cannot drag to select text.

Is there a way to temporarily remove the draggability while they are editing?

Most helpful comment

Ah, I just tapped into the 'disabled' option from Sortable.JS by adding that tied to a variable in the <draggable> component:

<draggable v-model="orderedTasks" :options="{disabled: editFocused}">

editFocused is a variable that I toggle the value of when a user is editing list item text.

All 2 comments

Ah, I just tapped into the 'disabled' option from Sortable.JS by adding that tied to a variable in the <draggable> component:

<draggable v-model="orderedTasks" :options="{disabled: editFocused}">

editFocused is a variable that I toggle the value of when a user is editing list item text.

Options props is deprecated, you can use :disabled="editFocused"

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Kuohao-wu picture Kuohao-wu  路  3Comments

steffanhalv picture steffanhalv  路  3Comments

Stetzon picture Stetzon  路  3Comments

Nrqz picture Nrqz  路  3Comments

clemsontiger picture clemsontiger  路  3Comments