Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit 78be91b

Browse files
committed
Fixed bug
When using sortable between two lists and a helper function (not 'clone') there is a problem if you drop an item at the last spot. The first time it works, the second time it will add it as the first element of the list. It continues this way for every even drop as the last item. You can check it here: http://codepen.io/anon/pen/FyaJs See issue here: #186
1 parent f8e98eb commit 78be91b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/sortable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ angular.module('ui.sortable', [])
125125
// the start and stop of repeat sections and sortable doesn't
126126
// respect their order (even if we cancel, the order of the
127127
// comments are still messed up).
128-
if (hasSortingHelper(element)) {
128+
if (hasSortingHelper(element) && !ui.item.sortable.received) {
129129
// restore all the savedNodes except .ui-sortable-helper element
130130
// (which is placed last). That way it will be garbage collected.
131131
savedNodes = savedNodes.not(savedNodes.last());

0 commit comments

Comments
 (0)