Replies: 1 comment 4 replies
-
Hey, that doesn't sound normal at all indeed, as htmx is supposed to avoid firing events for an element that has been removed from the DOM in the meantime, see Lines 2321 to 2323 in 6dbf554 Could you try adding logs inside a say a Hope this helps! |
Beta Was this translation helpful? Give feedback.
-
I have a page with autoreload enabled: every x seconds it reloads parts of the page using
hx-trigger="every {{ auto_reload_interval }}s"
in my backend template. Now I'm trying to have the user modify this autoreload behaviour and set a different interval. This swaps out the element with a newhx-trigger="every {{ new_autoreload_interval }}s"
. Users may also disable the autoreload, which swaps out the element without theevery
trigger. The issue I'm facing is that it appears that htmx/js still keeps the previous setTimeout running, which means that there will be an additional reload. This can lead to unexpected behaviour. It may even break the page if it results in two swaps happening at the same time.Is there any way to access the current timers and/or have htmx clear pending ones?
Beta Was this translation helpful? Give feedback.
All reactions