Skip to content

Commit 1e9ad0d

Browse files
committed
review fixes
uses getParentOrHost utility and moves logic to appropriate place
1 parent 7f0a463 commit 1e9ad0d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/Sortable.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ import {
3535
scrollBy,
3636
clone,
3737
expando,
38-
getChildContainingRectFromElement
38+
getChildContainingRectFromElement,
39+
getParentOrHost,
3940
} from './utils.js';
4041

4142

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

756757
while (target && target.shadowRoot) {
757758
target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
758-
const host = target.getRootNode().host;
759-
if (host) {
760-
target = host;
761-
}
762759
if (target === parent) break;
763760
parent = target;
764761
}
@@ -785,7 +782,7 @@ Sortable.prototype = /** @lends Sortable.prototype */ {
785782
target = parent; // store last element
786783
}
787784
/* jshint boss:true */
788-
while (parent = parent.parentNode);
785+
while (parent = getParentOrHost(parent));
789786
}
790787

791788
_unhideGhostForTarget();

0 commit comments

Comments
 (0)