From fd56ea370c371345cd9a34e65a615853ad882577 Mon Sep 17 00:00:00 2001 From: "Patrick H. Lauke" Date: Sun, 24 Sep 2017 12:00:54 +0200 Subject: [PATCH] Accessibility fixes to dynamic tabs (`aria-selected`, remove dynamic tabs with dropdowns) * Use `aria-selected` instead of `aria-expanded` * Change tab.js to use `aria-selected` rather than `aria-expanded` * Add `aria-orientation=vertical` to vertical tab list * Remove dynamic tabs with dropdowns * Fix non-interactive code examples * Only set `aria-selected` on the `role="tab"` trigger - this stops `aria-selected` being incorrectly added to the `role="tabpanel"` itself (probably harmless, but nonetheless incorrect) --- docs/4.0/components/navs.md | 166 +++++++++++++----------------------- js/src/tab.js | 8 +- js/tests/unit/tab.js | 26 +++--- 3 files changed, 79 insertions(+), 121 deletions(-) diff --git a/docs/4.0/components/navs.md b/docs/4.0/components/navs.md index a9fb5268b2..b34f79c2f9 100644 --- a/docs/4.0/components/navs.md +++ b/docs/4.0/components/navs.md @@ -301,22 +301,18 @@ If you're building our JS from source, it [requires `util.js`]({{ site.baseurl } Dynamic tabbed interfaces, as described in the [WAI ARIA Authoring Practices](https://www.w3.org/TR/wai-aria-practices/#tabpanel), require `role="tablist"`, `role="tab"`, `role="tabpanel"`, and additional `aria-` attributes in order to convey their structure, functionality and current state to users of assistive technologies (such as screen readers). +Note that dynamic tabbed interfaces should not contain dropdown menus, as this causes both usability and accessibility issues. From a usability perspective, the fact that the currently displayed tab's trigger element is not immediately visible (as it's inside the closed dropdown menu) can cause confusion. From an accessibility point of view, there is currently no sensible way to map this sort of construct to a standard WAI ARIA pattern, meaning that it cannot be easily made understandable to users of assistive technologies. +
@@ -326,38 +322,28 @@ Dynamic tabbed interfaces, as described in the [

Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.

-
{% highlight html %}
...
...
- - +
...
{% endhighlight %} @@ -365,17 +351,9 @@ To help fit your needs, this works with `