diff --git a/src/sortable.js b/src/sortable.js index a4daf13..e0ebc39 100644 --- a/src/sortable.js +++ b/src/sortable.js @@ -79,7 +79,7 @@ angular.module('ui.sortable', []) if (placeholder && placeholder.element) { savedNodes = savedNodes.not(element.find( "." + placeholder.element() - .attr('class').split(/\s+/).join('.'))); + .attr('class').split(/\s+/).join('.') + ':not(.ng-scope)')); } }; @@ -120,7 +120,10 @@ angular.module('ui.sortable', []) // If the received flag hasn't be set on the item, this is a // normal sort, if dropindex is set, the item was moved, so move // the items in the list. - if(!ui.item.sortable.received && ('dropindex' in ui.item.sortable) && !ui.item.sortable.isCanceled()) { + if(!ui.item.sortable.received && + ('dropindex' in ui.item.sortable) && + !ui.item.sortable.isCanceled()) { + scope.$apply(function () { ngModel.$modelValue.splice( ui.item.sortable.dropindex, 0,