You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>In this example we will use the <ahref="https://boosted.orange.com/docs/5.1/components/dropdowns/">drop-down menu</a> available in the <ahref="https://boosted.orange.com/">Boosted</a> library. This library based on Bootstrap allows you to quickly create <abbrtitle="User Interface">UI</abbr> components branded with the Orange colours.</p>
201
207
202
-
<p>The example implementation described below is suitable for navigation menus as well as for unit components presenting a list of actions.</p>
208
+
<p>Dropdown menus help organize and display navigation options or actions in a compact, structured way. However, if they are not properly implemented, they create accessibility issues for many users.</p>
209
+
<p>An accessible dropdown menu ensures smooth and intuitive navigation for everyone, while complying with the recommendations of standards (<abbr>WCAG</abbr>, <abbr>RGAA</abbr>, <abbr>EN 301 549</abbr>, etc.).</p>
210
+
<p>In the following examples, we will use the <ahref="https://boosted.orange.com/docs/5.1/components/dropdowns/">dropdown menu</a> available in the <ahref="https://boosted.orange.com/">Boosted</a> library.<br/> This Bootstrap‑based library makes it possible to quickly design accessible interfaces in Orange brand colors and compliant with WCAG as well as the <ahref="https://www.w3.org/WAI/ARIA/apg/patterns/combobox/">ARIA combobox design pattern</a></p>
203
211
204
-
<h2>Final example</h2>
205
-
<p>This is how the drop-down looks with our library.</p>
212
+
<h2>Dropdown menu</h2>
213
+
<p>To make the dropdown menu accessible, pay particular attention to the following:</p>
214
+
<ul>
215
+
<li>Support mouse and keyboard navigation (navigation with the <kbd>Tab</kbd> key, activation with <kbd>Enter</kbd> or <kbd>Space</kbd>, movement with the arrow keys).</li>
216
+
<li>Be compatible with assistive technologies (<abbr>AT</abbr>) by providing appropriate semantics, roles, and attributes (for example, <code>aria-expanded</code> and <code>aria-current</code>).</li>
217
+
<li>Provide sufficient visibility and contrast to ensure readable text and a clearly visible keyboard focus.</li>
218
+
<li>Ensure the behavior of the dropdown and item selection is predictable and consistent to avoid confusion.</li>
<p>For this menu to be accessible, it must be usable with a mouse, keyboard and screen reader.</p>
256
+
<h3><abbr>ARIA</abbr> attributes</h3>
257
+
<ul>
258
+
<li><code>aria-expanded</code>: the <code>aria-expanded</code> attribute with a value of <code>true/false</code> allows assistive technologies to announce the menu state (open or closed).</li>
259
+
<li><code>aria-current</code>: if the dropdown is used within a navigation menu, consider adding <code>aria-current="page"</code> to the item corresponding to the active page.</li>
260
+
<li><code>aria-haspopup</code>: the <code>aria-haspopup</code> attribute is reserved for the <code>menu</code> role (see the “Special case of application menus” section). It is therefore not present in this implementation.</li>
261
+
</ul>
262
+
263
+
<h2>Time to test</h2>
243
264
244
265
<h3>Keyboard navigation</h3>
245
266
<dl>
246
-
<dt>Move the focus to “My Account” using the <kbd>Tab</kbd> key and press the <kbd>Enter</kbd> key.</dt>
267
+
<dt>Move focus to the “My account” button using the <kbd>Tab</kbd> key and activate with the <kbd>Enter</kbd> key.</dt>
247
268
<dd>The menu opens.</dd>
248
-
<dt>Use the <kbd>up</kbd> / <kbd>down</kbd> arrows.</dt>
249
-
<dd>These allow you to navigate the different menu items.</dd>
250
-
<dt>Press <kbd>Escape</kbd>.</dt>
251
-
<dd>The menu closes. On closing, the focus is automatically repositioned onto the button that opened the menu.</dd>
252
-
<dt></dt>
269
+
<dt>Use the <kbd>Up</kbd>/<kbd>Down</kbd> arrow keys.</dt>
270
+
<dd>These allow you to move between the different menu items.</dd>
271
+
<dt>Press the <kbd>Escape</kbd> key.</dt>
272
+
<dd>The menu closes. When it closes, focus is automatically returned to the button that opens the menu.</dd>
253
273
</dl>
254
274
255
275
<h3>Screen reader navigation</h3>
256
276
<dl>
257
-
<dt>Position the cursor on “My Account”.</dt>
258
-
<dd>The screen reader says there is a drop-down menu, and vocalizes the drop-down state (open or closed).</dd>
277
+
<dt>Place focus on the “My account” button.</dt>
278
+
<dd>The screen reader indicates that it is a dropdown menu and announces the menu state (open or closed).</dd>
259
279
<dt>Press the <kbd>Enter</kbd> key.</dt>
260
-
<dd>The menu opens, the first item is selected. This element is automatically vocalized by the screen reader.</dd>
261
-
<dt>Use the <kbd>up</kbd> / <kbd>down</kbd>arrows.</dt>
262
-
<dd>These allow you to navigate to the different menu items.</dd>
280
+
<dd>The menu opens, the first item is selected, and it is automatically announced by the screen reader.</dd>
281
+
<dt>Use the <kbd>Up</kbd>/<kbd>Down</kbd>arrow keys.</dt>
282
+
<dd>These allow you to move between the different menu items.</dd>
263
283
<dt>Select a menu item using the <kbd>Enter</kbd> key.</dt>
264
-
<dd>The menu closes. As the focus is repositioned automatically, the screen reader again vocalizes the menu button, and its state.</dd>
284
+
<dd>The menu closes. Since focus is automatically returned, the screen reader announces the menu button again, along with its state.</dd>
265
285
</dl>
266
286
267
-
<h3><abbr>ARIA</abbr> attributes</h3>
268
-
269
-
<ul>
270
-
<li><code>aria-expanded</code>: the <code>aria-expanded</code> attribute with a <code>true</code>/<code>false</code> value, allows to vocalize menu states (open or closed).</li>
271
-
<li><code>aria-current</code>: if the dropdown menu is used within a navigation menu, provide for the addition of an attribute <code>aria-current="page"</code> on the item corresponding to the active page.</li>
272
-
<li><code>aria-haspopup</code>: the <code>aria-haspopup</code> attribute is reserved for the <code> menu </code> role (see paragraph "Special case of application menus"). It is therefore not present in this implementation.</li>
<p>In addition, the ARIA pattern describes the use of an <code>aria-controls</code> attribute, as well as additional optional keyboard interactions: <kbdlang="en">Home</kbd> / <kbdlang="en">End</kbd></p>
288
+
<p>Additionally, the ARIA pattern describes the use of an <code>aria-controls</code> attribute, as well as optional extra keyboard interactions: <kbd>Home</kbd>/<kbd>End</kbd>.</p>
287
289
<p>Example: <ahref="https://www.w3.org/WAI/ARIA/apg/example-index/disclosure/disclosure-navigation.html">Example Disclosure for Navigation Menus</a></p>
288
290
289
291
<h2>Special case of application menus</h2>
290
292
291
-
<p>The ARIA pattern describes a "Menu" and "Menubar" component, using the roles <code>menu</code>or<code>menubar</code>.</p>
292
-
<p>Please note, this pattern is reserved only for the creation of an application menu, the interactions of which should be similar to the behavior of the menus present in desktop applications for example.</p>
293
-
<p>These implementations are more complex and unnecessary for web navigation menus.</p>
293
+
<p>The ARIA pattern describes “Menu” and “Menubar” components, using the <code>menu</code>and<code>menubar</code> roles.</p>
294
+
<p>Note that this pattern is intended only for building application menus, whose interactions should be similar to menus in desktop applications, for example.</p>
295
+
<p>These implementations are more complex and not necessary for web navigation menus.</p>
0 commit comments