diff --git a/Sortable.js b/Sortable.js index 83735b9e9..5a1c3b0ef 100644 --- a/Sortable.js +++ b/Sortable.js @@ -1027,11 +1027,14 @@ /** @returns {HTMLElement|false} */ function _ghostInBottom(el, evt) { - var lastEl = el.lastElementChild, - rect = lastEl.getBoundingClientRect(); - - return (evt.clientY - (rect.top + rect.height) > 5) && lastEl; // min delta - } ++ var lastEl = el.lastElementChild; ++ if (lastEl===ghostEl) { ++ lastEl = lastEl.previousElementSibling || ghostEl; ++ } ++ var rect = lastEl.getBoundingClientRect(); + + return (evt.clientY - (rect.top + rect.height) > 5) && lastEl; // min delta + } /**