|
@@ -96,7 +96,7 @@ export default class Component {
|
|
|
// Register all our listeners and set all our attribute bindings.
|
|
|
// If we're cloning a component, the third parameter ensures no duplicate
|
|
|
// event listeners are registered (the mutation observer will take care of them)
|
|
|
- this.initializeElements(this.$el, () => {}, componentForClone ? false : true)
|
|
|
+ this.initializeElements(this.$el, () => {}, componentForClone)
|
|
|
|
|
|
// Use mutation observer to detect new elements being added within this component at run-time.
|
|
|
// Alpine's just so darn flexible amirite?
|
|
@@ -197,7 +197,7 @@ export default class Component {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- initializeElements(rootEl, extraVars = () => {}, shouldRegisterListeners = true) {
|
|
|
+ initializeElements(rootEl, extraVars = () => {}, componentForClone = false) {
|
|
|
this.walkAndSkipNestedComponents(rootEl, el => {
|
|
|
// Don't touch spawns from for loop
|
|
|
if (el.__x_for_key !== undefined) return false
|
|
@@ -205,9 +205,9 @@ export default class Component {
|
|
|
// Don't touch spawns from if directives
|
|
|
if (el.__x_inserted_me !== undefined) return false
|
|
|
|
|
|
- this.initializeElement(el, extraVars, shouldRegisterListeners)
|
|
|
+ this.initializeElement(el, extraVars, componentForClone ? false : true)
|
|
|
}, el => {
|
|
|
- el.__x = new Component(el)
|
|
|
+ if(! componentForClone) el.__x = new Component(el)
|
|
|
})
|
|
|
|
|
|
this.executeAndClearRemainingShowDirectiveStack()
|