Skip to content

Commit

Permalink
#1487: Detect for empty insert always if not inserted
Browse files Browse the repository at this point in the history
  • Loading branch information
owen-m1 committed Apr 12, 2019
1 parent 4836502 commit 6f7fc27
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 6f7fc27

Please sign in to comment.