Преглед на файлове

Don't init trees within ignore elements (x-ignore)

Caleb Porzio преди 6 месеца
родител
ревизия
463f2770ed
променени са 1 файла, в които са добавени 3 реда и са изтрити 0 реда
  1. 3 0
      packages/alpinejs/src/lifecycle.js

+ 3 - 0
packages/alpinejs/src/lifecycle.js

@@ -83,6 +83,9 @@ let initInterceptors = []
 export function interceptInit(callback) { initInterceptors.push(callback) }
 
 export function initTree(el, walker = walk, intercept = () => {}) {
+    // Don't init a tree within a parent that is being ignored.
+    if (findClosest(el, i => i._x_ignore)) return
+
     deferHandlingDirectives(() => {
         walker(el, (el, skip) => {
             intercept(el, skip)