bigskysoftware / bigskysoftware/htmx
`htmx.config.ignoreTitle = true` is in conflict with OOB-swapped `title` top element
- Dominant language
- JavaScript
- Stars
- 49.4k
- Forks
- 1.7k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 30
Description
Version 2.0.9.
### Steps
1) `htmx.config.ignoreTitle = true` is set.
1) The web page has an OOB-swappable `title` tag in `head` block: `One`.
1) Perform an htmx swap where the response contains `Two` as one of the "top" tags in the response.
### Expected
The tab title is `Two`.
### Actual
The tab title is `One`.
### Why is this needed?
I use OOB-swappable titles as a workaround for another bug: https://github.com/bigskysoftware/htmx/issues/3726. And `htmx.config.ignoreTitle = true` is set to nudge the developers to use this pattern consistently until the bug is fixed.
### Notes
Setting `htmx.config.ignoreTitle = false` or wrapping the `title` in the response with, say, `div` helps.
Contributor guide
Research direction
Start by reproducing the issue's minimal htmx.config.ignoreTitle and title hx-swap-oob example, then trace the title and out-of-band swap handling. Add a regression test covering ignoreTitle=true with an OOB-swapped title, and confirm that the document title becomes "Two" while the existing behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html, javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100