bigskysoftware / bigskysoftware/htmx

head extension mishandles title

Open
#4,070 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
49.4k
Forks
1.7k
Avg merge
3d 22h
Merged PRs (30d)
30

Description

The trouble with the title tag appears when using the extension with `hx-head="append"`.
The title is something that intrinsically changes between pages and so when using `append` it will cause multiple titles to appear.
The problem affects the extension for both htmx v2 and v4.

For my local workaround, I disable title handing entirely, since htmx already handles titles itself and so there's an argument that it's not the extension's responsibility to manage them at all.

Here is a simple reproduction with two pages using boosting. Toggling between the two results in multiple title elements.
**Page 1**
```html




Page 1


Page 2

```
**Page 2**
```html




Page 2


Page 1

```

Contributor guide

Open the contributing guide

Research direction

Start with the hx-head extension entry point and reproduce the behavior using the two HTML pages in the issue with hx-head="append" and boosted navigation. Trace how title elements are handled between Page 1 and Page 2; done means toggling between them no longer leaves multiple title elements, for both htmx v2 and v4.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.