diff --git a/ng-sortable.js b/ng-sortable.js index 235c46b..eb005be 100644 --- a/ng-sortable.js +++ b/ng-sortable.js @@ -123,6 +123,11 @@ } else { items.splice(newIndex, 0, items.splice(oldIndex, 1)[0]); + + // move ng-repeat comment node to right position + if (nextSibling.nodeType === Node.COMMENT_NODE) { + evt.from.insertBefore(nextSibling, evt.item.nextSibling); + } } scope.$apply();