Skip to content

Commit bd74abb

Browse files
committed
fix: Sortable crashes browser when event is triggered from within ShadowDom element
1 parent 63ecb31 commit bd74abb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function matches(/**HTMLElement*/el, /**String*/selector) {
3838
}
3939

4040
function getParentOrHost(el) {
41-
return (el.host && el !== document && el.host.nodeType)
41+
return (el.host && el !== document && el.host.nodeType && el.host !== el)
4242
? el.host
4343
: el.parentNode;
4444
}
@@ -256,7 +256,7 @@ function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoS
256256

257257
/**
258258
* Returns the content rect of the element (bounding rect minus border and padding)
259-
* @param {HTMLElement} el
259+
* @param {HTMLElement} el
260260
*/
261261
function getContentRect(el) {
262262
let rect = getRect(el);

0 commit comments

Comments
 (0)