Open rettgerst opened 7 years ago
Same problem here.
here is how I worked around this issue:
1) change the dnd-moved
attribute on the <tr>
element to dnd-dragstart
2) give the <tbody>
element a dnd-drop
attribute: model.listDrop(item, index)
3) and that callback:
vm.listDrop = function (item, index) {
vm.list.splice(index - 1, 0, item);
$scope.$apply();
return true;
};
I was having this issue for a ul with draggable li elements, but realized I had an extra li element at the top that wasn't part of the ng-repeat, causing everything to be off by one.
In @rettgerst's html above, same is true with the table (extra tr at the top, not part of the ng-repeat).
So I think this bug may be considere user-error :(
here is my basic html:
very simple and based on the "simple list" example.
when I drop a file, the directive places the item one below where it should be. if I wanted to drag an item at index N it would place it at N+1.