-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When the response contains "HX-Redirect" the hx-indicator element is not deactivated. (htmx-v2) #3189
Comments
Are you using hx-disabled-elt? Or maybe I'm not understanding something... |
I am sorry I have not explained the problem in the right manner. Usually when I set the attribute hx-indicator="#spinner" the element with id="spinner" is shown (because htmx library add some classes) when the htmx ajax call begin. |
Oh I see! (Sorry for the delay btw) |
I checked and found that after-request event is fired. |
Hey, the fact that spinners are not removed upon If I understand correctly here, you redirect to a page that triggers a download, thus doesn't actually change the active page? I wonder if that's a situation possible to identify at the htmx level... I'm really not sure of that as we simply set Btw, if I understand correctly, this means that every subsequent page refresh would trigger the download again as the page URL changed ; is that what you want here? Because if not, I'm thinking you might want to use another mechanism than HX-Redirect in this case (such as responding with a hidden link, that points to the downloadable URL with the |
The page doesn't change because the redirect is toward a "file download" link. On page refresh the download is not triggered again. |
Thanks for the details If you are interested to look into it, please feel free to work on a PR that would resolve this situation. |
When the response contains "HX-Redirect" the hx-indicator element is not deactivated.
The HX-Redirect header is set to redirect the browser to another page so someone could be think that hx-indicator element deactivation is not needed, but if the redirect is toward a file download link the browser page is not reloaded so the hx-indicator element should be deactivated.
The text was updated successfully, but these errors were encountered: