diff --git a/packages/alpinejs/src/lifecycle.js b/packages/alpinejs/src/lifecycle.js index 81c1226d7..eae66fec6 100644 --- a/packages/alpinejs/src/lifecycle.js +++ b/packages/alpinejs/src/lifecycle.js @@ -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)) diff --git a/packages/alpinejs/src/mutation.js b/packages/alpinejs/src/mutation.js index 72905ec8b..29e396784 100644 --- a/packages/alpinejs/src/mutation.js +++ b/packages/alpinejs/src/mutation.js @@ -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