Skip to content
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

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

Open
danjac opened this issue Oct 10, 2024 · 2 comments
Open

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

danjac opened this issue Oct 10, 2024 · 2 comments

Comments

@danjac
Copy link

danjac commented Oct 10, 2024

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
Copy link
Author

danjac commented Oct 10, 2024

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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants