bigskysoftware / bigskysoftware/htmx
HX-Location doesn't appear to be working
- Dominant language
- JavaScript
- Stars
- 49.4k
- Forks
- 1.7k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 30
Description
I want to give users the ability to navigate deep into a crud area of the application from the dashboard. To do this I'm utilizing HX-Location, e.g.

I am returning some _hypermedia_ to be inserted into the specified target:

However, while the page container matching the path is successfully loaded, the container (which is part of the base response) doesn't receive what I wanted to render into it:

Am I right that the way this is intended to work is:
a) HTMX receives response1, which contains the HX-Location header, as well as content1, which is temporarily held; it makes a request for the path
b) HTMX receives response2, lets it settle, and then inserts content1 into the target specified in response1's HX-Location header
?
That's what appears to be (mostly) happening here. /edit is the initial request from the dashboard; my backend detects that we're not on the path that we need to be, and so dynamically adds the HX-Location with the response; /ingredients is then requested, and renders...but then (as above) we fail to render the original response from /edit into it.

Contributor guide
Assessment
This issue has not been assessed yet.