MaxLeiter / sortablejs-vue3

A thin wrapper around Sortable.js for Vue 3
https://sortablejs-vue3.maxleiter.com
MIT License
378 stars 19 forks source link

`onMove` incompatible with SortableJs #90

Open nopeless opened 1 year ago

nopeless commented 1 year ago

emit('onMove') does not have the desirable effect

In SortableJs, you are able to cancel a move by returning a value from onMove() call. However, because of the way the code is implemented right now, this functionality is completely disabled.

https://github.com/MaxLeiter/sortablejs-vue3/blob/201bff662acf2d09e82e99057c6524fc1e8930d2/src/components/Sortable.vue#L91-L116

Related issue https://github.com/vuejs/core/issues/8865

The reason is because emit() does not return the value from the handler.

Here are some proposals

nopeless commented 1 year ago

I am willing to submit a pr