I'm seeing differences in the sortable events from JQuery Sortable and Angular Sortable although my understanding is that the Angular events and options should the same as JQuery:
"All the jQueryUI Sortable options can be passed through the directive." https://github.com/angular-ui/ui-sortable
The following shows a jquery sortable. When an item is dragged and dropped an alert shows the index of the dropped item AFTER its dropped. http://jsfiddle.net/L7jemdbh/
$(".sort-list-horizontal").sortable({containment: 'parent', tolerance: "pointer" })
.on( "sortupdate", function( event, ui ) { alert(ui.item.index()); } );
The same sortable using Angular has the same alert however it shows the item's index BEFORE the item is dropped. http://jsfiddle.net/zobgawqt/
$scope.sortableOptions = {
tolerance: 'pointer',
update: function(event, ui) { alert(ui.item.index()); }
};
Why is the Angular version different? How do I find the index after the drop?
(I also note that the containment option works in the jquery version but not in the Angular version so I've turned it off)