From f95fb46bb1a9fa54ce54c88b105e2317f82f8683 Mon Sep 17 00:00:00 2001 From: sp-kilobug Date: Mon, 24 Aug 2015 18:40:07 +0200 Subject: [PATCH] fix multiline float/flex --- Sortable.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Sortable.js b/Sortable.js index b8be6fa..9c2dd08 100644 --- a/Sortable.js +++ b/Sortable.js @@ -639,7 +639,13 @@ after = (moveVector === 1); } else if (floating) { - after = (target.previousElementSibling === dragEl) && !isWide || halfway && isWide; + var elTop = dragEl.offsetTop, + tgTop = target.offsetTop; + if (elTop===tgTop) { + after = (target.previousElementSibling === dragEl) && !isWide || halfway && isWide; + } else { + after = tgTop > elTop; + } } else { after = (nextSibling !== dragEl) && !isLong || halfway && isLong; }