Skip to content

Commit

Permalink
SortableJS#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 authored and elo7-developer committed Nov 18, 2019
1 parent 2db3b30 commit 4076df2
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 @@ -791,10 +791,10 @@ define('sortable', [], function sortableFactory() {
_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 @@ -1166,10 +1166,14 @@ define('sortable', [], function sortableFactory() {
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 4076df2

Please sign in to comment.