Skip to content

Commit 7f263a3

Browse files
committed
fix: prevent duplicate entity init for :each attribute
1 parent f9746f2 commit 7f263a3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/entity.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@ export default class Entity {
271271
.replaceAll(variable, `'${escapeHTML(item)}'`)
272272
})
273273

274+
// ObserveDOM will be called for updated DOM to initialize the entities
274275
this.element.innerHTML = newHTML
275-
this.initChildren()
276276
}
277277
}
278278

@@ -422,6 +422,7 @@ export default class Entity {
422422
// Add event listeners
423423
Object.keys(this.listener).forEach((key) => {
424424
const listener = this.listener[key]
425+
425426
if (Array.isArray(listener)) {
426427
listener.forEach(({ el, eventName, event }) => {
427428
el.addEventListener(eventName, event)

0 commit comments

Comments
 (0)