Wrong oldIndex in nested Sortable events
See original GitHub issueHello,
I made a Sortable (let’s call it B) inside a Sortable (let’s call it A) item element. When I drag B’s items around, oldIndex property seems to be the parent’s index instead of its own.
For example, if inside A2 I drag B4 and put it at index 3, the event’s indexes will be
oldIndex: 2,
newIndex: 3
instead of
oldIndex: 4,
newIndex: 3
http://jsbin.com/henuzikaka/edit?html,js,output
On a side note, it seems that on the dev branch all indexes new and old, nested or not, are always 0.
Issue Analytics
- State:
- Created 8 years ago
- Comments:9
Top Results From Across the Web
jquery ui sortable: How to get current index with id and old ...
I am using jquery UI to change the position of the table and pass this jquery event arguments through ajax while taking index...
Read more >jQuery Sortable
Sorts any items in any container · Fully supports nested containers · Connect lists · Callbacks and events (see docs) · Pure drag/drop...
Read more >Sortablejs-nesting NPM
Sortable is a minimalist JavaScript library for reorderable drag-and-drop lists. Demo: http://rubaxa.github.io/Sortable/. Features. Supports touch devices and ...
Read more >Sortable Widget | jQuery UI API Documentation
Function: A function that will return a DOMElement to use while dragging. The function receives the event and the element being sorted. Code...
Read more >Sortable - Best of JS
Sortable is a JavaScript library for reorderable drag-and-drop lists. ... before cancelling a delayed drag event disabled: false, // Disables the sortable ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Any reason this is not merged into master yet? Just noticed this issue, and the commit solves it. I think most of the referenced use cases is for nested, but independent sortables and not the unsupported sortable “tree”.
+1