Skip to content

Commit

Permalink
fix: already init component
Browse files Browse the repository at this point in the history
  • Loading branch information
Matsa59 committed Jan 3, 2024
1 parent b24d8be commit 8a3ba01
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 2 additions & 0 deletions packages/alpinejs/src/lifecycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ export function interceptInit(callback) { initInterceptors.push(callback) }
export function initTree(el, walker = walk, intercept = () => {}) {
deferHandlingDirectives(() => {
walker(el, (el, skip) => {
el._x_isInit = true

intercept(el, skip)

initInterceptors.forEach(i => i(el, skip))
Expand Down
4 changes: 0 additions & 4 deletions packages/alpinejs/src/mutation.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,6 @@ function onMutate(mutations) {
node._x_ignore = true
})
for (let node of addedNodes) {
// If an element gets moved on a page, it's registered
// as both an "add" and "remove", so we want to skip those.
if (removedNodes.includes(node)) continue

// If the node was eventually removed as part of one of his
// parent mutations, skip it
if (! node.isConnected) continue
Expand Down

0 comments on commit 8a3ba01

Please sign in to comment.