Browse Source

wip (#2762)

* wip

* wip
Caleb Porzio 3 years ago
parent
commit
9e79850a2a
1 changed files with 2 additions and 0 deletions
  1. 2 0
      packages/alpinejs/src/utils/on.js

+ 2 - 0
packages/alpinejs/src/utils/on.js

@@ -28,6 +28,8 @@ export default function on (el, event, modifiers, callback) {
         handler = wrapHandler(handler, (next, e) => {
             if (el.contains(e.target)) return
 
+            if (e.target.isConnected === false) return
+
             if (el.offsetWidth < 1 && el.offsetHeight < 1) return
 
             // Additional check for special implementations like x-collapse