test the details element
This is to test AT with the <details>
element and various invocations
HTML spec for the <details>
element: https://html.spec.whatwg.org/#the-details-element
From the spec: The details element represents a disclosure widget from which the user can obtain additional information or controls.
What about accessibility?
The details
element:
The summary
element:
details
elementConsider this code:
<details>
<summary>User Menu</summary>
<ul>
<li><a href="/">Home</a></li>
<li><a href="./about">About</a></li>
<li><a href="./contact">Contact Us</a></li>
</ul>
</details>
I tried this in these combinations:
Assistive Tech (AT) will tell the user something like this:
Once you press the button (technically here the summary element, although the entire elements stays focused), it will announce something like:
You can then press TAB (or VO + TAB in Safari) to navigate to the next interactive element, which in this case would be the "Home" link and would be read (in most cases) like, "list with three items. home, link."
Technically this works, even if it's a bit confusing to use with a screen-reader. I expected a disclosure widget and now I'm in a list with links?
If I use my keyboard shortcuts (VO + U, then left/right arrow key through the lists)
details
element in the "links" listNothing associates the two or combines them. This is, I think, the crux of the issue.
Unfortunately, a11y testing is not throwing an error right now for no-nested-interactive elements, so there's no indication that doing this is harmful or undesired. /shrug