Skip to content

Event onMove does not support the return value #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
YahorDanchanka opened this issue Dec 27, 2022 · 1 comment
Closed

Event onMove does not support the return value #55

YahorDanchanka opened this issue Dec 27, 2022 · 1 comment

Comments

@YahorDanchanka
Copy link
Contributor

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
Copy link
Contributor Author

I'm attaching a pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants