Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
uses getParentOrHost utility and moves logic to appropriate place
  • Loading branch information
driskull committed Mar 18, 2024
1 parent 7f0a463 commit 1e9ad0d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/Sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ import {
scrollBy,
clone,
expando,
getChildContainingRectFromElement
getChildContainingRectFromElement,
getParentOrHost,
} from './utils.js';


Expand Down Expand Up @@ -755,10 +756,6 @@ Sortable.prototype = /** @lends Sortable.prototype */ {

while (target && target.shadowRoot) {
target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
const host = target.getRootNode().host;
if (host) {
target = host;
}
if (target === parent) break;
parent = target;
}
Expand All @@ -785,7 +782,7 @@ Sortable.prototype = /** @lends Sortable.prototype */ {
target = parent; // store last element
}
/* jshint boss:true */
while (parent = parent.parentNode);
while (parent = getParentOrHost(parent));
}

_unhideGhostForTarget();
Expand Down

0 comments on commit 1e9ad0d

Please sign in to comment.