htmx
htmx copied to clipboard
Combining several event modifiers in `hx-trigger` doesn't work correctly
Example:
<div hx-trigger="load once delay:100ms" ws-send=""> blah-blah </div>
Will only take care of delay:100ms, the once will be ignored. It's quite unclear how to achieve a combined result.
I think “load” is only triggered once anyway?
once - the event will only trigger once (e.g. the first click)
This example will load /news immediately on page load, and then again with a delay of one second after each click.
https://htmx.org/attributes/hx-trigger/
I’m curious what result you are getting.
Edit: I just found this in the htmx book, so it seems that htmx will trigger load events on every request:
In load polling, we take advantage of the fact that htmx triggers a load event when content is loaded into the DOM.