Skip to content

Commit c192b54

Browse files
committed
deploy: 79d5d3c
1 parent fe910d4 commit c192b54

File tree

43 files changed

+871
-833
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+871
-833
lines changed

en/articles/dropdown-menu/index.html

Lines changed: 57 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
<button type="button" class="btn btn-outline-secondary dropdown-toggle" id="mobile-toc-dropdown-handler" data-bs-toggle="dropdown" aria-expanded="false">
164164
On this page
165165
</button>
166-
<div class="dropdown-menu dropdown-menu-right"><a href="#" class="dropdown-item text-wrap">Introduction</a><a href="#" class="dropdown-item text-wrap">Final example</a><a href="#" class="dropdown-item text-wrap">Code example</a><a href="#" class="dropdown-item text-wrap">Testing</a><a href="#" class="dropdown-item text-wrap">Keyboard navigation</a><a href="#" class="dropdown-item text-wrap">Screen reader navigation</a><a href="#" class="dropdown-item text-wrap">ARIA attributes</a><a href="#" class="dropdown-item text-wrap">Special case of application menus</a></div>
166+
<div class="dropdown-menu dropdown-menu-right"><a href="#" class="dropdown-item text-wrap">Introduction</a><a href="#" class="dropdown-item text-wrap">Dropdown menu</a><a href="#" class="dropdown-item text-wrap">Example</a><a href="#" class="dropdown-item text-wrap">Example code</a><a href="#" class="dropdown-item text-wrap">ARIA attributes</a><a href="#" class="dropdown-item text-wrap">Time to test</a><a href="#" class="dropdown-item text-wrap">Keyboard navigation</a><a href="#" class="dropdown-item text-wrap">Screen reader navigation</a><a href="#" class="dropdown-item text-wrap">Special case of application menus</a></div>
167167
</nav>
168168

169169
</div>
@@ -187,23 +187,38 @@ <h1>Dropdown menu</h1>
187187

188188
<p class="text-muted mb-0">
189189
<span class="visually-hidden">Publication date</span>
190-
<time datetime="2018-01-17T00:00:00.000Z">
191-
January 17, 2018
190+
<time datetime="2026-03-13T00:00:00.000Z">
191+
March 13, 2026
192192
</time>
193193
</p>
194194

195195

196+
<p class="text-muted mb-0">
197+
Update of the article from
198+
<time datetime="2018-01-17T00:00:00.000Z">
199+
January 17, 2018
200+
</time>
201+
</p>
202+
196203

197204
<div class="mt-4">
198205

199206
<h2>Introduction</h2>
200-
<p>In this example we will use the <a href="https://boosted.orange.com/docs/5.1/components/dropdowns/">drop-down menu</a> available in the <a href="https://boosted.orange.com/">Boosted</a> library. This library based on Bootstrap allows you to quickly create <abbr title="User Interface">UI</abbr> components branded with the Orange colours.</p>
201207

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 <a href="https://boosted.orange.com/docs/5.1/components/dropdowns/">dropdown menu</a> available in the <a href="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 <a href="https://www.w3.org/WAI/ARIA/apg/patterns/combobox/">ARIA combobox design pattern</a></p>
203211

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>
219+
</ul>
206220

221+
<h2>Example</h2>
207222
<!-- Final menu -->
208223
<div class="dropdown">
209224
<button class="btn btn-outline-secondary dropdown-toggle" type="button" id="dropdownMenu1" data-bs-toggle="dropdown">
@@ -213,84 +228,71 @@ <h2>Final example</h2>
213228
<ul class="dropdown-menu">
214229
<li><a class="dropdown-item" href="#">My cart</a></li>
215230
<li><a class="dropdown-item" href="#">My orders</a></li>
216-
<li><a class="dropdown-item" href="#">My details</a></li>
231+
<li><a class="dropdown-item" href="#">My informations</a></li>
217232
<li role="separator" class="dropdown-divider"></li>
218233
<li><a class="dropdown-item" href="#">Log out</a></li>
219234
</ul>
220235
</div>
221236

222-
<h2>Code example</h2>
237+
<h3>Example code</h3>
223238

224-
<!-- Example 1 code -->
239+
<!-- Example code 1 -->
225240
<pre><code class="html">
226241
&lt;div class="dropdown"&gt;
227-
&lt;button class="btn btn-outline-secondary dropdown-toggle" type="button" id="dropdownMenu1" data-bs-toggle="dropdown"&gt;
242+
&lt;button class="btn btn-outline-secondary dropdown-toggle" aria-expanded="false" type="button" id="dropdownMenu1" data-bs-toggle="dropdown"&gt;
228243
My account
229244
&lt;span class="caret"&gt;&lt;/span&gt;
230245
&lt;/button&gt;
231246
&lt;ul class="dropdown-menu"&gt;
232247
&lt;li&gt;&lt;a class="dropdown-item" href="#"&gt;My cart&lt;/a&gt;&lt;/li&gt;
233248
&lt;li&gt;&lt;a class="dropdown-item" href="#"&gt;My orders&lt;/a&gt;&lt;/li&gt;
234-
&lt;li&gt;&lt;a class="dropdown-item" href="#"&gt;My details&lt;/a&gt;&lt;/li&gt;
249+
&lt;li&gt;&lt;a class="dropdown-item" href="#"&gt;My information&lt;/a&gt;&lt;/li&gt;
235250
&lt;li role="separator" class="dropdown-divider"&gt;&lt;/li&gt;
236251
&lt;li&gt;&lt;a class="dropdown-item" href="#"&gt;Log out&lt;/a&gt;&lt;/li&gt;
237252
&lt;/ul&gt;
238253
&lt;/div&gt;
239254
</code></pre>
240255

241-
<h2>Testing</h2>
242-
<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>
243264

244265
<h3>Keyboard navigation</h3>
245266
<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>
247268
<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>
253273
</dl>
254274

255275
<h3>Screen reader navigation</h3>
256276
<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>
259279
<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>
263283
<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>
265285
</dl>
266286

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>
273-
</ul>
274287

275-
<pre><code class="html">
276-
&lt;button aria-expanded="false"&gt;Mon compte&lt;/button&gt;
277-
&lt;ul class="dropdown-menu"&gt;
278-
&lt;li&gt;&lt;a class="dropdown-item" href="#"&gt;Mon panier&lt;/a&gt;&lt;/li&gt;
279-
&lt;li&gt;&lt;a class="dropdown-item" href="#" aria-current="page"&gt;Mes commandes&lt;/a&gt;&lt;/li&gt;
280-
&lt;li&gt;&lt;a class="dropdown-item" href="#"&gt;Mes informations&lt;/a&gt;&lt;/li&gt;
281-
&lt;li role="separator" class="dropdown-divider"&gt;&lt;/li&gt;
282-
&lt;li&gt;&lt;a class="dropdown-item" href="#"&gt;Déconnexion&lt;/a&gt;&lt;/li&gt;
283-
&lt;/ul&gt;
284-
</code></pre>
285-
286-
<p>In addition, the ARIA pattern describes the use of an <code>aria-controls</code> attribute, as well as additional optional keyboard interactions: <kbd lang="en">Home</kbd> / <kbd lang="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>
287289
<p>Example: <a href="https://www.w3.org/WAI/ARIA/apg/example-index/disclosure/disclosure-navigation.html">Example Disclosure for Navigation Menus</a></p>
288290

289291
<h2>Special case of application menus</h2>
290292

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>
294296

295297
<p>Example: <a href="https://www.w3.org/WAI/ARIA/apg/example-index/menubar/menubar-navigation.html">Editor Menubar Example</a></p>
296298

@@ -303,13 +305,15 @@ <h2>Special case of application menus</h2>
303305
<h2 id="toc-title">On this page</h2>
304306
<ul class="nav flex-column"><li class="nav-item position-relative">
305307
<a href="#" class="nav-link text-muted">Introduction</a></li><li class="nav-item position-relative">
306-
<a href="#" class="nav-link text-muted">Final example</a></li><li class="nav-item position-relative">
307-
<a href="#" class="nav-link text-muted">Code example</a></li><li class="nav-item position-relative">
308-
<a href="#" class="nav-link text-muted">Testing</a>
308+
<a href="#" class="nav-link text-muted">Dropdown menu</a></li><li class="nav-item position-relative">
309+
<a href="#" class="nav-link text-muted">Example</a>
309310
<ul><li class="nav-item position-relative">
310-
<a href="#" class="nav-link text-muted">Keyboard navigation</a></li><li class="nav-item position-relative">
311-
<a href="#" class="nav-link text-muted">Screen reader navigation</a></li><li class="nav-item position-relative">
311+
<a href="#" class="nav-link text-muted">Example code</a></li><li class="nav-item position-relative">
312312
<a href="#" class="nav-link text-muted">ARIA attributes</a></li></ul></li><li class="nav-item position-relative">
313+
<a href="#" class="nav-link text-muted">Time to test</a>
314+
<ul><li class="nav-item position-relative">
315+
<a href="#" class="nav-link text-muted">Keyboard navigation</a></li><li class="nav-item position-relative">
316+
<a href="#" class="nav-link text-muted">Screen reader navigation</a></li></ul></li><li class="nav-item position-relative">
313317
<a href="#" class="nav-link text-muted">Special case of application menus</a></li>
314318
</ul>
315319
</nav>

0 commit comments

Comments
 (0)