Skip to content

Commit 44ffc4d

Browse files
Editorial: Clarify aria-expanded guidance (#1980)
Co-authored-by: Scott O'Hara <[email protected]>
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 @@ <h2>Definitions of States and Properties (all aria-* attributes)</h2>
1368013680
<div class="state" id="aria-expanded">
1368113681
<sdef>aria-expanded</sdef>
1368213682
<div class="state-description">
13683-
<p><a>Indicates</a> whether a grouping element that is the <a>accessibility child</a> of or is controlled by this element is expanded or collapsed.</p>
13684-
<p>
13685-
The <sref>aria-expanded</sref> 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-
<rref>treeitem</rref> to indicate whether its child branch of the tree is shown. Similarly, it can be applied to a <rref>button</rref> that controls visibility of a section of page
13687-
content.
13688-
</p>
13689-
<p>
13690-
If a grouping container that can be expanded or collapsed is not the <a>accessibility child</a> of the element that has the <sref>aria-expanded</sref> attribute, the author SHOULD
13691-
identify the controlling relationship by referencing the container from the element that has <sref>aria-expanded</sref> with the <pref>aria-controls</pref> property.
13692-
</p>
13683+
<p><a>Indicates</a> whether a related element is expanded (shown) or collapsed (hidden).</p>
13684+
<p>The <sref>aria-expanded</sref> attribute is applied to a focusable, interactive element that toggles visibility of content of a different element. If the element with <sref>aria-expanded</sref> is also a <rref>treeitem</rref> in a <rref>tree</rref> or a <rref>row</rref> in a <rref>treegrid</rref>, then it SHOULD also be the <a>accessibility parent</a> of the content it expands and collapses. Otherwise, the element with <sref>aria-expanded</sref> SHOULD NOT be the <a>accessibility parent</a> of the content that is expanding or collapsing. Rather, identify that relationship between the interactive element and the element being controlled using <pref>aria-controls</pref>.</p>
13685+
<p>For example, <sref>aria-expanded</sref> is applied to a parent <rref>treeitem</rref> to indicate whether its child branch of the tree is shown.</p>
13686+
<pre class="example highlight">&lt;ul role="tree"&gt;
13687+
&lt;li role="treeitem" aria-expanded="false" aria-selected="false"&gt;
13688+
&lt;span&gt;Fruits&lt;/span&gt;
13689+
&lt;ul role="group" hidden&gt;
13690+
&lt;li role="treeitem" aria-selected="false"&gt;Apricot&lt;/li&gt;
13691+
&lt;li role="treeitem" aria-selected="false"&gt;Mangosteen&lt;/li&gt;
13692+
&lt;li role="treeitem" aria-selected="false"&gt;Yuzu&lt;/li&gt;
13693+
&lt;/ul&gt;
13694+
&lt;/li&gt;
13695+
&lt;/ul&gt;</pre>
13696+
<p>Similarly, it can be applied to a <rref>button</rref> to control the visibility of another element and its content on the current page.</p>
13697+
<pre class="example highlight">&lt;button type="button" aria-controls="mangosteen" aria-expanded="false"&gt;Mangosteen&lt;/button&gt;
13698+
&lt;div id="mangosteen" hidden&gt;
13699+
An edible fruit native to tropical lands surrounding the Indian Ocean.
13700+
&lt;/div&gt;</pre>
1369313701
</div>
1369413702
<table class="def">
1369513703
<caption>

0 commit comments

Comments
 (0)