diff --git a/Sortable.js b/Sortable.js index 7888d05..6de4e05 100644 --- a/Sortable.js +++ b/Sortable.js @@ -704,8 +704,13 @@ } } - // Drag end event - Sortable.active && _dispatchEvent(this, rootEl, 'end', dragEl, rootEl, oldIndex, newIndex); + if (Sortable.active) { + // Drag end event + _dispatchEvent(this, rootEl, 'end', dragEl, rootEl, oldIndex, newIndex); + + // Save sorting + this.save(); + } } // Nulling @@ -726,9 +731,6 @@ activeGroup = Sortable.active = null; - - // Save sorting - this.save(); } },