bigskysoftware / htmx

</> htmx - high power tools for HTML
https://htmx.org
Other
38.61k stars 1.31k forks source link

HX-Location broken in 2.0.3: htmx:targetError #2958

Open danjac opened 1 month ago

danjac commented 1 month ago

I have a URL returning HX-Location like this: {path: '/some-other-url/'}. Page is "redirected" to the new URL.

This works fine in htmx 2.0.2, in 2.0.3 it breaks with htmx:targetError. Target is defined correctly in parent element.

danjac commented 1 month ago

It appears that it is now compulsory to specify target with the HX-Location e.g. {path: '/some-other-url/', target: '#content'}.

Previously, I think, HTMX was able to use the target specified in the parent element. This looks like either a bug, or a behavior change (which shouldn't happen for a minor point update IMHO).

MichaelWest22 commented 1 month ago

Looks like this is indeed a bug that has already been found. I have a PR up #2948 that will fix this