Skip to content

Is it possible to prevent SortableJS from moving the HTMLElement? #2138

Answered by owen-m1
nicholasrice asked this question in Q&A
Discussion options

You must be logged in to vote

Yes it's possible using the onMove option. It gives you all relevant information about where the element being dragged over, and if you return false; in that function, the dragged element will not actually be moved.
Unfortunately this will mean the user won't see it moving in the list in real-time (because sortable actually moves the element when doing this).

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by owen-m1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants