Skip to content

Commit

Permalink
SortableJS#1434: Target must be immediate child of sortable
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 bd99967 commit fa4b927
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ define('sortable', [], function sortableFactory() {
scrollSensitivity: 30,
scrollSpeed: 10,
bubbleScroll: true,
draggable: /[uo]l/i.test(el.nodeName) ? 'li' : '>*',
draggable: /[uo]l/i.test(el.nodeName) ? '>li' : '>*',
swapThreshold: 1, // percentage; 0 <= x <= 1
invertSwap: false, // invert always
invertedSwapThreshold: null, // will be set to same as swapThreshold if default
Expand Down Expand Up @@ -1197,7 +1197,7 @@ define('sortable', [], function sortableFactory() {
return completed();
}
}
else if (target && target !== dragEl && (target.parentNode[expando] !== void 0) && target !== el) {
else if (target && target !== dragEl && target.parentNode === el) {
var direction = 0,
targetBeforeFirstSwap,
aligned = target.sortableMouseAligned,
Expand Down Expand Up @@ -1678,7 +1678,14 @@ define('sortable', [], function sortableFactory() {
ctx = ctx || document;

do {
if ((selector === '>*' && el.parentNode === ctx) || _matches(el, selector) || (includeCTX && el === ctx)) {
if (
selector != null &&
(
selector[0] === '>' && el.parentNode === ctx && _matches(el, selector.substring(1)) ||
_matches(el, selector) ||
(includeCTX && el === ctx)
)
) {
return el;
}

Expand Down

0 comments on commit fa4b927

Please sign in to comment.