Skip to content

docs(html): limit index section toggle to the label width#4186

Open
grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:fix/docs-summary-name-click
Open

docs(html): limit index section toggle to the label width#4186
grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:fix/docs-summary-name-click

Conversation

@grandixximo

@grandixximo grandixximo commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Summary

On the documentation index page, clicking anywhere on a section row toggled the expandable <details> section, including the empty space far to the right of the label. The native <details>/<summary> markup introduced in 277dafc ("apply bertho's index.html JS-free patch") renders <summary> as a full-width list-item, so the whole row became the click target.

This restores the intended behavior: only the section name is clickable. Clicks in the empty space to the right of the label no longer toggle the section.

Change

docs/src/index.css: add width: fit-content; to summary, shrinking the click target to the label width.

Verification

Built the index page locally and tested with a headless browser across all 17 <details> sections:

  • clicking the label name toggles the section
  • clicking the empty space to the right of the name does nothing (the hit target is the <details> container, not the <summary>)

@BsAtHome I remember that I already fixed this once, and I think it was you being annoyed by the thing expanding when you clicked on the right side, or am I remembering wrong?

Native <details>/<summary> renders the summary as a full-width
list-item, so a click anywhere on the row toggled the section. Set
the summary to width: fit-content so only the label name is clickable
and clicks in the empty space to its right do nothing.
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.

1 participant