I am having a weird bug with AngularUI's ui-sortable directive. For the most part, dragging the elements seems fine where the index gets updated when an element is dragged into the new position. However, there are occurrences when it is not getting updated. I have created a repeatable instance where the issue comes up. On first run, drag the line 2 // two line down one row and the index is clearly not updated.
Is there a method to fix this?
HTML:
<section ng:controller="controller" ui-sortable ng-model="nums">
<div ng-repeat="i in nums">
{{$index}} // {{i}}
</div>
</section>
JS:
var myapp = angular.module('myapp', ['ui']);
myapp.controller('controller', function ($scope) {
$scope.nums = ['zero','one','two','three','four','five'];
});
angular.bootstrap(document, ['myapp']);