sortablejs-vue3 icon indicating copy to clipboard operation
sortablejs-vue3 copied to clipboard

`onMove` incompatible with SortableJs

Open nopeless opened this issue 2 years ago • 1 comments

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

  • Use props instead of emits
  • Respect the SortableOption instead of always overwriting them
  • Wait until Vue updates emit behavior, and mention that this functionality doesn't work

nopeless avatar Aug 20 '23 21:08 nopeless

I am willing to submit a pr

nopeless avatar Aug 20 '23 21:08 nopeless