fix: initialize htmx on dynamically loaded dom nodes
This commit is contained in:
+1
@@ -50,6 +50,7 @@ export default class extends Controller {
|
|||||||
this.loadedValue = true
|
this.loadedValue = true
|
||||||
this.containerTarget.innerHTML = html
|
this.containerTarget.innerHTML = html
|
||||||
this.triggerTarget.remove()
|
this.triggerTarget.remove()
|
||||||
|
htmx.process(this.containerTarget)
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
this.loadedValue = false
|
this.loadedValue = false
|
||||||
|
|||||||
+1
@@ -39,6 +39,7 @@ export default class extends Controller {
|
|||||||
.then(html => {
|
.then(html => {
|
||||||
this.resultsContainerTarget.innerHTML = html
|
this.resultsContainerTarget.innerHTML = html
|
||||||
window.scroll({ top: 0, left: 0, behavior: 'smooth' })
|
window.scroll({ top: 0, left: 0, behavior: 'smooth' })
|
||||||
|
htmx.process(this.resultsContainerTarget)
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.loadingValue = false
|
this.loadingValue = false
|
||||||
|
|||||||
+1
@@ -28,6 +28,7 @@ export default class extends Controller {
|
|||||||
.then(this.parseHTML)
|
.then(this.parseHTML)
|
||||||
.then(html => {
|
.then(html => {
|
||||||
this.containerTarget.innerHTML = html
|
this.containerTarget.innerHTML = html
|
||||||
|
htmx.process(this.containerTarget)
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.loadingValue = false
|
this.loadingValue = false
|
||||||
|
|||||||
Reference in New Issue
Block a user