From 6f7fc27e5fc6a9c58623851101711f175275588e Mon Sep 17 00:00:00 2001 From: owen-m1 Date: Thu, 11 Apr 2019 20:26:38 -0400 Subject: [PATCH] #1487: Detect for empty insert always if not inserted --- Sortable.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sortable.js b/Sortable.js index d355813dc..f400208ae 100644 --- a/Sortable.js +++ b/Sortable.js @@ -801,10 +801,10 @@ _find(dragEl, criteria.trim(), _disableDraggable); }); - // We do not want this to be triggered if completed (bubbling canceled), so only define it here _on(document, 'dragover', nearestEmptyInsertDetectEvent); _on(document, 'mousemove', nearestEmptyInsertDetectEvent); _on(document, 'touchmove', nearestEmptyInsertDetectEvent); + if (options.supportPointer) { _on(ownerDocument, 'pointerup', _this._onDrop); } else { @@ -1176,10 +1176,14 @@ if ((target === dragEl && !dragEl.animated) || (target === el && !target.animated)) { lastTarget = null; } + // no bubbling and not fallback if (!options.dragoverBubble && !evt.rootEl && target !== document) { _this._handleAutoScroll(evt); dragEl.parentNode[expando]._computeIsAligned(evt); + + // Do not detect for empty insert if already inserted + !insertion && nearestEmptyInsertDetectEvent(evt); } !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();