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

Event onMove does not support the return value #55

Closed YahorDanchanka closed 1 year ago

YahorDanchanka commented 1 year ago

From documentation SortableJS in onMove event I can return value to write some logic:

// Event when you move an item in the list or between lists
onMove: function (/**Event*/evt, /**Event*/originalEvent) {
  // Example: https://jsbin.com/nawahef/edit?js,output
  evt.dragged; // dragged HTMLElement
  evt.draggedRect; // DOMRect {left, top, right, bottom}
  evt.related; // HTMLElement on which have guided
  evt.relatedRect; // DOMRect
  evt.willInsertAfter; // Boolean that is true if Sortable will insert drag element after target by default
  originalEvent.clientY; // mouse position
  // return false; — for cancel
  // return -1; — insert before target
  // return 1; — insert after target
  // return true; — keep default insertion point based on the direction
  // return void; — keep default insertion point based on the direction
},

But I can't repeat it on this wrapper.

YahorDanchanka commented 1 year ago

I'm attaching a pull request