Skip to content

Commit 463f277

Browse files
committed
Don't init trees within ignore elements (x-ignore)
1 parent 8f4e57b commit 463f277

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/alpinejs/src/lifecycle.js

+3
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ let initInterceptors = []
8383
export function interceptInit(callback) { initInterceptors.push(callback) }
8484

8585
export function initTree(el, walker = walk, intercept = () => {}) {
86+
// Don't init a tree within a parent that is being ignored.
87+
if (findClosest(el, i => i._x_ignore)) return
88+
8689
deferHandlingDirectives(() => {
8790
walker(el, (el, skip) => {
8891
intercept(el, skip)

0 commit comments

Comments
 (0)