Fix technical claims of tree and treeitem roles - #45645
Conversation
| In some implementations of single-select tree, the focused item also has a selected state; this is known as "selection follows focus". When a single-select tree receives focus, if none of the tree items are selected before the tree receives focus, focus is set on the first node. If a tree item is selected before the tree receives focus, focus is set on the selected tree item. In single-select trees, [`aria-selected`](/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-selected) is set to `true` on the selected tree item and `false` on all other selectable tree items. Do not include the attribute on tree items that are not selectable. | ||
|
|
||
| In multi-select trees, all selected tree items have `aria-selected="true"` set and all tree item nodes that are selectable but not currently selected have `aria-selected="false"` set. Do not include the `aria-selected` attribute on tree items that are not selectable. |
There was a problem hiding this comment.
Actually, these two paragraphs now look repetitive... It doesn't look like we need to differentiate between "single-select" and "multi-select" anymore; just say all selected tree items have true.
There was a problem hiding this comment.
Agreed—consolidated the attribute-value guidance into one paragraph for both modes in 1b9eb5d. It retains true for selected items, false for selectable but unselected items, and omission for non-selectable items. The selection-count and focus guidance is unchanged. The “trees that use aria-selected” qualifier avoids excluding implementations that indicate selection with aria-checked instead.
Target-page MarkdownLint, Prettier, front-matter, and filecheck all pass locally (Node 24.21.0, npm 11.19.0).
|
@estelle This needs another look from you. I looked around and found a bunch of technical inaccuracies for |
|
Preview URLs (2 pages)
(comment last updated: 2026-09-29 17:23:50) |
Co-authored-by: Estelle Weyl <estelle@openwebdocs.org>
b40e2b4 to
cf57b55
Compare
cf57b55 to
2158ecf
Compare
Description
Corrects the single-select tree guidance so
aria-selectedistrueon the selected tree item,falseon other selectable tree items, and omitted only from tree items that are not selectable.Motivation
The previous wording told readers to omit
aria-selectedfrom every unselected item. That made it difficult for assistive technologies to distinguish an unselected selectable item from an item that cannot be selected.Additional details
Validated with the target-page MarkdownLint, Prettier, front-matter, and file-check scripts under Node 24.21.0 and npm 11.19.0.
Related issues and pull requests
Fixes #41378