htmx
htmx copied to clipboard
How to prevent the window <title> from being replaced.
I have a couple of links that I'm loading into modals using hx-get
, with hx-select
to only swap certain elements. This all works fine except the parent page's window title is changed to the title of the page I requested. I don't need this to happen, as these are modals.
I saw this was added here: https://github.com/bigskysoftware/htmx/commit/0f72543171c5bc10431d8d4a0439952cb46c79e5 but I'm not sure why it's not optional seeing as hx-select
is the workaround to not requesting pages that are only fragments. Is there a way to prevent this?
Does the content that is being returned have a title in it? Is there a way to prevent that if the HX-Request
request header is sent?
That's actually an idea. I'll give this a go, possibly with the help fo the django-htmx
plugin. Thanks.