-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Head tags duplicating on body's children elements after swap events #2018
Comments
This solution seems ok... or it's just a temp fix? 🤔 var startTag = getStartTag(resp);
if (htmx.config.useTemplateFragments && partialResponse) {
if (startTag === 'head') {
resp = resp.replace(/<head>[\s\S]*?<\/head>/, '');
}
...
} else {
...
} |
fercomunello
added a commit
to fercomunello/htmx
that referenced
this issue
Nov 21, 2023
fercomunello
added a commit
to fercomunello/htmx
that referenced
this issue
Nov 21, 2023
4 tasks
fercomunello
added a commit
to fercomunello/htmx
that referenced
this issue
Nov 22, 2023
1cg
pushed a commit
that referenced
this issue
Dec 20, 2023
@1cg Hey, thanks for the merge! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to reproduce?
1) Include the template fragment parsing config via a meta tag or script:
2) Make sure the page title changes with the new content when clicking on the links and if the title appears once on
<head>
or if it's duplicated on the<body>
.3) Now comment the config or set it to false and see that the issue does not happen!
Set-up environment
In order to simulate the XHR requests I just used IntelliJ's open in browser feature (which uses websockets) but the same behaviour occurs on a normal web server.
Download code
https://gist.github.com/fercomunello/701c36db4acf47580e324e6e2202c655
Demo
The text was updated successfully, but these errors were encountered: