htmx icon indicating copy to clipboard operation
htmx copied to clipboard

[RFC] Always use latest `href`/`hx-*` in `hx-boost`

Open leiffoged opened this issue 3 years ago • 1 comments

hx-boost seems to capture the href/hx-get/etc of an element when the boosting logic is setup.

But if the element changes its href since it was created, hx-boost will cause it to redirect to the wrong location. While opening that link in a new tab/window (bypassing hx-boost) will sent to the correct URL.

This proposed change would -- when performing an AJAX request -- revalidate that the element should be boosted and compute the verb/path at that time.

Thanks for your consideration! :)

leiffoged avatar Aug 15 '22 19:08 leiffoged

I like this change but I'd like to do it for hx-get, etc. as well. Are you willing to look at that bigger change?

1cg avatar Sep 30 '22 20:09 1cg

We recently moved our hx-boost usage to turbolinks (while still using HTMX for everything else), so I probably won't have the bandwidth to get to this. Sorry! :)

leiffoged avatar Oct 02 '22 16:10 leiffoged