Skip to content

Commit

Permalink
#447: fixed newIndex if eq null or -1
Browse files Browse the repository at this point in the history
  • Loading branch information
RubaXa committed Sep 15, 2015
1 parent 4a67b43 commit 7fd16cb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -791,8 +791,11 @@
}
}

if (newIndex >= 0) {
// Only if we really move the item.
if (Sortable.active) {
if (newIndex == null || newIndex === -1) {
newIndex = oldIndex;
}

_dispatchEvent(this, rootEl, 'end', dragEl, rootEl, oldIndex, newIndex);

// Save sorting
Expand Down

0 comments on commit 7fd16cb

Please sign in to comment.