The contextual links button reveals a menu when pressed. The open/closed state is visually apparent, and this should also be conveyed to assistive technology, in a machine-readable way.
Currently the button uses a combination of aria-pressed
and changing the name of the button from "Open blockname configuration options" to "Close blockname configuration options".
Current screen reader announcements:
This has some problems:
aria-pressed
is the wrong property. This is intended for toggle switches which have an on/off behaviour, such as a user preference or UI mode (e.g. "show outlines", or a "mute sound" button). For a button which opens and closes a menu or other container, the appropriate property is aria-expanded
.NOTE: this issue is only concerned with contextual links buttons on blocks. We are not changing the behaviour of the toolbar button provided by the Contextual Links module.
aria-pressed
attribute with aria-expanded
in contextual links button. Assisitive tech will convey the expanded/collapsed state based on this. The semantics of this also convey that the button causes something else to be revealed, rather than purely reflecting it's own state.data-contextual-id
on the parent container DIV, we can re-use that with "-list" concatenated on the end as the list ID.aria-controls="foo"
(foo is the ID of the UL), so that the button is programatically associated with the thing it changes.aria-expanded
, and the correct association via aria-controls
.
Proposed screen reader announcements:
The exact screen announcements vary between screen readers; the important part is that collapsed/expanded phrases are localized by the OS, not Drupal. This is useful where the web page language differs from the OS interface language.
Patch.
Manual testing, confirm it works as intended with assistive technology.
None.
None.
Needs work
10.1 ✨
It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.
It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
No activities found.