Reputation: 189
I have encountered an interesting problem. First, imagine following URL structure:
I configured all 3 pages to have hx-boost="true"
on the body tag and use boosted anchor tags for all my navigation.
Here are the simple steps to reprodure my problem:
/admin
admin/[id]
(notice how I use a relative path)/admin/[id]/scores
successfullyanswers
(The browser shows /admin/[id]/answers
when hovering over the anchor tag)/answers
instead of /admin/[id]/answers
Also the other way around:
/admin/[id]/answers
/admin
(this time with an absolute path)/admin
successfullyadmin/[id]
(now a relative path again)/admin/q/[id]/admin/q/[id]
(huh?)Did I miss something in the documentation regarding hx-boost and relative URLs? Because if I remove the hx-boost="true"
from my links that navigate "vertically" instead of "horizontally" everything works just fine.
Upvotes: 1
Views: 1556
Reputation: 59375
this looks like https://github.com/bigskysoftware/htmx/issues/1476
Order of hx-boost checking and history pushing causes issues with relative links
at the time of posting the workaround seems to be to disable link boosting.
Upvotes: 1