marcospont / agnostic-draggable

An agnostic set of libraries implementing draggable, droppable, sortable and resizable behaviors inspired by the jQuery UI implementation
MIT License
39 stars 7 forks source link

Position/index of sorted element(s) before/after moved #4

Closed brandonmcconnell closed 3 years ago

brandonmcconnell commented 3 years ago

It would be helpful to see both the previously selected sortable and the moved element's previous position/index in that list as well as the new sortable it is a part of and its new position/index.

I see a position property, but it returns all null values. — see attached E8c09D3X0AccQI_

marcospont commented 3 years ago

The sortable:update event was changed to include more arguments, including the previous and the new indexes of any element being sorted within a single sortable or between two sortable instances.

The following commit addresses your suggestion: https://github.com/marcospont/agnostic-draggable/commit/08902cd0451b6e3066a26189b8627b49f1b37e41

Thanks, Marcos