From 1e9ad0d56a9a88d75cad4872eb0b5e87ec56ec44 Mon Sep 17 00:00:00 2001 From: Matt Driscoll Date: Mon, 18 Mar 2024 11:16:30 -0700 Subject: [PATCH] review fixes uses getParentOrHost utility and moves logic to appropriate place --- src/Sortable.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Sortable.js b/src/Sortable.js index e091810fb..823d88b32 100644 --- a/src/Sortable.js +++ b/src/Sortable.js @@ -35,7 +35,8 @@ import { scrollBy, clone, expando, - getChildContainingRectFromElement + getChildContainingRectFromElement, + getParentOrHost, } from './utils.js'; @@ -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; } @@ -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();