Skip to content

Commit 6f7fc27

Browse files
committed
#1487: Detect for empty insert always if not inserted
1 parent 4836502 commit 6f7fc27

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sortable.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,10 +801,10 @@
801801
_find(dragEl, criteria.trim(), _disableDraggable);
802802
});
803803

804-
// We do not want this to be triggered if completed (bubbling canceled), so only define it here
805804
_on(document, 'dragover', nearestEmptyInsertDetectEvent);
806805
_on(document, 'mousemove', nearestEmptyInsertDetectEvent);
807806
_on(document, 'touchmove', nearestEmptyInsertDetectEvent);
807+
808808
if (options.supportPointer) {
809809
_on(ownerDocument, 'pointerup', _this._onDrop);
810810
} else {
@@ -1176,10 +1176,14 @@
11761176
if ((target === dragEl && !dragEl.animated) || (target === el && !target.animated)) {
11771177
lastTarget = null;
11781178
}
1179+
11791180
// no bubbling and not fallback
11801181
if (!options.dragoverBubble && !evt.rootEl && target !== document) {
11811182
_this._handleAutoScroll(evt);
11821183
dragEl.parentNode[expando]._computeIsAligned(evt);
1184+
1185+
// Do not detect for empty insert if already inserted
1186+
!insertion && nearestEmptyInsertDetectEvent(evt);
11831187
}
11841188

11851189
!options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();

0 commit comments

Comments
 (0)