Skip to content

docs: clarify next/previous selectors scan whole DOM, not just siblings (#3430)#3769

Open
manwithacat wants to merge 1 commit intobigskysoftware:masterfrom
manwithacat:fix/docs-previous-next-not-sibling
Open

docs: clarify next/previous selectors scan whole DOM, not just siblings (#3430)#3769
manwithacat wants to merge 1 commit intobigskysoftware:masterfrom
manwithacat:fix/docs-previous-next-not-sibling

Conversation

@manwithacat
Copy link
Copy Markdown
Contributor

Fixes #3430.

The parenthetical examples for the next <CSS selector> and previous <CSS selector> extended-target syntax described the result as the closest sibling with the matching class. The surrounding sentence already correctly describes the actual behavior (a forward/backward DOM scan that can land on elements at any hierarchy level), but the examples in parentheses contradicted it. As @MichaelWest22 noted in the issue, this is "a copy paste error in the documentation from when that feature was added."

This PR replaces "sibling" with "element" in those examples and adds a brief clarifying clause, in 10 places across 5 docs:

  • www/content/attributes/hx-target.md (next + previous)
  • www/content/attributes/hx-trigger.md (next + previous)
  • www/content/attributes/hx-include.md (next + previous)
  • www/content/attributes/hx-disabled-elt.md (next + previous)
  • www/content/extensions/response-targets.md (next + previous)

Docs-only — targeting master per CONTRIBUTING.md.

…gs (bigskysoftware#3430)

The parenthetical examples for `next <CSS selector>` and `previous <CSS selector>`
described the result as the "closest following/previous sibling", but the actual
behavior (correctly described in the surrounding sentence) is a forward/backward
DOM scan that can match elements at any hierarchy level — not just siblings of
the source element.

Replaces "sibling" with "element" and adds a brief clarifying note in 10 places
across 5 attribute and extension docs (hx-target, hx-trigger, hx-include,
hx-disabled-elt, response-targets).

No code change; only the parenthetical examples were misleading.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

previous <CSSselector> and next <CSSselector> find more than just siblings. Improve docs?

1 participant