htmx icon indicating copy to clipboard operation
htmx copied to clipboard

How to prevent the window <title> from being replaced.

Open onyekaa opened this issue 3 years ago • 2 comments

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?

onyekaa avatar Jul 24 '21 20:07 onyekaa

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?

1cg avatar Sep 06 '21 15:09 1cg

That's actually an idea. I'll give this a go, possibly with the help fo the django-htmx plugin. Thanks.

onyekaa avatar Sep 14 '21 08:09 onyekaa