docs: clarify next/previous selectors scan whole DOM, not just siblings (#3430)#3769
Open
manwithacat wants to merge 1 commit intobigskysoftware:masterfrom
Open
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3430.
The parenthetical examples for the
next <CSS selector>andprevious <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
masterper CONTRIBUTING.md.