fix: initialize htmx on dynamically loaded dom nodes

This commit is contained in:
Björn Fromme
2024-11-14 16:06:28 +01:00
parent f79096c11a
commit fa3fde986f
3 changed files with 3 additions and 0 deletions
@@ -50,6 +50,7 @@ export default class extends Controller {
this.loadedValue = true
this.containerTarget.innerHTML = html
this.triggerTarget.remove()
htmx.process(this.containerTarget)
})
.catch(() => {
this.loadedValue = false
@@ -39,6 +39,7 @@ export default class extends Controller {
.then(html => {
this.resultsContainerTarget.innerHTML = html
window.scroll({ top: 0, left: 0, behavior: 'smooth' })
htmx.process(this.resultsContainerTarget)
})
.finally(() => {
this.loadingValue = false
@@ -28,6 +28,7 @@ export default class extends Controller {
.then(this.parseHTML)
.then(html => {
this.containerTarget.innerHTML = html
htmx.process(this.containerTarget)
})
.finally(() => {
this.loadingValue = false