From bd74abb22ade431c0e1af0cd552796ec1e0bcb0c Mon Sep 17 00:00:00 2001 From: Marvin Scharle Date: Wed, 26 Mar 2025 10:25:10 +0100 Subject: [PATCH] fix: Sortable crashes browser when event is triggered from within ShadowDom element --- src/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils.js b/src/utils.js index c26c5bb90..43112a4d3 100644 --- a/src/utils.js +++ b/src/utils.js @@ -38,7 +38,7 @@ function matches(/**HTMLElement*/el, /**String*/selector) { } function getParentOrHost(el) { - return (el.host && el !== document && el.host.nodeType) + return (el.host && el !== document && el.host.nodeType && el.host !== el) ? el.host : el.parentNode; } @@ -256,7 +256,7 @@ function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoS /** * Returns the content rect of the element (bounding rect minus border and padding) - * @param {HTMLElement} el + * @param {HTMLElement} el */ function getContentRect(el) { let rect = getRect(el);