diff --git a/lrDragNDrop.js b/lrDragNDrop.js index 2b7c383..2ef5dff 100644 --- a/lrDragNDrop.js +++ b/lrDragNDrop.js @@ -150,6 +150,9 @@ break; } } + if (dropIndex < 0) { + dropIndex = 0; + } } scope.$apply(function () { collection.splice(dropIndex, 0, item); @@ -181,4 +184,4 @@ } }; }]); -})(angular); \ No newline at end of file +})(angular);