Async auth via hx-trigger="load"? #3386
-
|
https://htmx.org/examples/async-auth/ shows how to implement an async auth workflow. This works great with the example, which fires when a button is clicked. However, I'd like to trigger it via |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Can you try with hx-trigger="load delay:1ms"? There can be issues with load trigger as it tries to fire its ajax request the moment the element is being inited by htmx and this can sometimes happen before some hx-on events are loaded. delaying it a tick or two should allow things to get setup before the trigger fires the request. |
Beta Was this translation helpful? Give feedback.
Can you try with hx-trigger="load delay:1ms"? There can be issues with load trigger as it tries to fire its ajax request the moment the element is being inited by htmx and this can sometimes happen before some hx-on events are loaded. delaying it a tick or two should allow things to get setup before the trigger fires the request.