Skip to content

Commit 593235d

Browse files
committed
fix _ghostIsFirst error
1 parent 558c633 commit 593235d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Sortable.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1170,6 +1170,8 @@ Sortable.prototype = /** @lends Sortable.prototype */ {
11701170
let elLastChild = lastChild(el, options.draggable);
11711171

11721172
if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {
1173+
// Insert to end of list
1174+
11731175
// If already at end of list: Do not insert
11741176
if (elLastChild === dragEl) {
11751177
return completed(false);
@@ -1194,6 +1196,7 @@ Sortable.prototype = /** @lends Sortable.prototype */ {
11941196
}
11951197
}
11961198
else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {
1199+
// Insert to start of list
11971200
let firstChild = getChild(el, 0, options, true);
11981201
if (firstChild === dragEl) {
11991202
return completed(false);
@@ -1780,7 +1783,7 @@ function _unsilent() {
17801783
}
17811784

17821785
function _ghostIsFirst(evt, vertical, sortable) {
1783-
let rect = getRect(getChild(sortable.el, 0, sortable.options));
1786+
let rect = getRect(getChild(sortable.el, 0, sortable.options, true));
17841787
const spacer = 10;
17851788

17861789
return vertical ?

0 commit comments

Comments
 (0)