Skip to content

Commit

Permalink
Don't init trees within ignore elements (x-ignore)
Browse files Browse the repository at this point in the history
  • Loading branch information
calebporzio committed Nov 3, 2024
1 parent 8f4e57b commit 463f277
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/alpinejs/src/lifecycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 463f277

Please sign in to comment.