htmx icon indicating copy to clipboard operation
htmx copied to clipboard

loading-state ext width HX-Redirect

Open nykolaslima opened this issue 1 year ago • 2 comments

When using “hx-post” within a form and the loading-state ext the loading behavior works as expected.

but when the backend returns a “HX-Redirect” header the loading state stops, because it understands that the request was fulfilled.

shouldn’t it keep the loading state until the redirect completes? Is this a bug or this behavior should be achieved using some other configuration?

nykolaslima avatar Jan 02 '24 00:01 nykolaslima

@1cg could you help here? I was thinking about making a change to loading-state ext to support this behavior but not pretty sure if there is any side effect on doing it

nykolaslima avatar Jan 05 '24 19:01 nykolaslima

hey @nykolaslima i'm kind deep in the 2.0 release, but can maybe look at this near the end of January. In the meantime, don't be afraid to hack up the loading-state extension, it isn't that complicated and you can always run your own custom extension that does what you need.

1cg avatar Jan 05 '24 20:01 1cg