Skip to content

Commit 44ffc4d

Browse files
Editorial: Clarify aria-expanded guidance (#1980)
Co-authored-by: Scott O'Hara
1 parent 1ecc159 commit 44ffc4d

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

index.html

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13680,16 +13680,24 @@

Definitions of States and Properties (all aria-* attributes)

1368013680
1368113681
aria-expanded
1368213682
13683-

Indicates whether a grouping element that is the accessibility child of or is controlled by this element is expanded or collapsed.

13684-

13685-
The aria-expanded attribute is applied to a focusable, interactive element that toggles visibility of content in another element. For example, it is applied to a parent
13686-
treeitem to indicate whether its child branch of the tree is shown. Similarly, it can be applied to a button that controls visibility of a section of page
13687-
content.
13688-

13689-

13690-
If a grouping container that can be expanded or collapsed is not the accessibility child of the element that has the aria-expanded attribute, the author SHOULD
13691-
identify the controlling relationship by referencing the container from the element that has aria-expanded with the aria-controls property.
13692-

13683+

Indicates whether a related element is expanded (shown) or collapsed (hidden).

13684+

The aria-expanded attribute is applied to a focusable, interactive element that toggles visibility of content of a different element. If the element with aria-expanded is also a treeitem in a tree or a row in a treegrid, then it SHOULD also be the accessibility parent of the content it expands and collapses. Otherwise, the element with aria-expanded SHOULD NOT be the accessibility parent of the content that is expanding or collapsing. Rather, identify that relationship between the interactive element and the element being controlled using aria-controls.

13685+

For example, aria-expanded is applied to a parent treeitem to indicate whether its child branch of the tree is shown.

13686+
<ul role="tree">
13687+
<li role="treeitem" aria-expanded="false" aria-selected="false">
13688+
<span>Fruits</span>
13689+
<ul role="group" hidden>
13690+
<li role="treeitem" aria-selected="false">Apricot</li>
13691+
<li role="treeitem" aria-selected="false">Mangosteen</li>
13692+
<li role="treeitem" aria-selected="false">Yuzu</li>
13693+
</ul>
13694+
</li>
13695+
</ul>
13696+

Similarly, it can be applied to a button to control the visibility of another element and its content on the current page.

13697+
<button type="button" aria-controls="mangosteen" aria-expanded="false">Mangosteen</button>
13698+
<div id="mangosteen" hidden>
13699+
An edible fruit native to tropical lands surrounding the Indian Ocean.
13700+
</div>
1369313701
1369413702
1369513703

0 commit comments

Comments
 (0)