Selaa lähdekoodia

Fixed shadow dom parent issue (#1986)

Dede Muzaffer 3 vuotta sitten
vanhempi
commit
b1c11fd2b8
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      packages/trap/src/index.js

+ 1 - 1
packages/trap/src/index.js

@@ -39,7 +39,7 @@ export default function (Alpine) {
 }
 
 function crawlSiblingsUp(el, callback) {
-    if (el.isSameNode(document.body)) return
+    if (el.isSameNode(document.body) || ! el.parentNode) return
 
     Array.from(el.parentNode.children).forEach(sibling => {
         if (! sibling.isSameNode(el)) callback(sibling)