From 463f2770ed5efb66b6487c9a33dfb7c8d116765d Mon Sep 17 00:00:00 2001 From: Caleb Porzio Date: Sun, 3 Nov 2024 14:18:35 -0500 Subject: [PATCH] Don't init trees within ignore elements (x-ignore) --- packages/alpinejs/src/lifecycle.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/alpinejs/src/lifecycle.js b/packages/alpinejs/src/lifecycle.js index 4e12fe9b3..e4d787685 100644 --- a/packages/alpinejs/src/lifecycle.js +++ b/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)