diff --git a/Sortable.js b/Sortable.js index 8b32dfb..db811ee 100644 --- a/Sortable.js +++ b/Sortable.js @@ -1117,12 +1117,14 @@ } }, this); - order.forEach(function (id) { - if (items[id]) { - rootEl.removeChild(items[id]); - rootEl.appendChild(items[id]); - } - }); + if (typeof order !== 'undefined') { + order.forEach(function (id) { + if (items[id]) { + rootEl.removeChild(items[id]); + rootEl.appendChild(items[id]); + } + }); + } },