From 1f7036c6c391ebc84506a2af806c570d7e55db1c Mon Sep 17 00:00:00 2001 From: RubaXa Date: Wed, 27 Sep 2017 15:39:05 +0300 Subject: [PATCH] #1143: + additional parent check --- Sortable.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Sortable.js b/Sortable.js index 3d6ae34..214bc2b 100644 --- a/Sortable.js +++ b/Sortable.js @@ -643,8 +643,10 @@ // #1143: IFrame support workaround _nextTick(function () { - rootEl.insertBefore(cloneEl, dragEl); - _dispatchEvent(_this, rootEl, 'clone', dragEl); + if (dragEl && (dragEl.parentNode === rootEl)) { + rootEl.insertBefore(cloneEl, dragEl); + _dispatchEvent(_this, rootEl, 'clone', dragEl); + } }); }