Page MenuHomePhabricator

Collapsible HTMLForm state by jquery.makeCollapsible should be clearer exposed to screen readers
Closed, ResolvedPublic

Description

Currently show/hide button only carries “show” and “hide” as links without a fully concise explanation about what they are showing and hiding aside of the legend being the next element in DOM.

It should provide an indicative aria-expanded attribute.

Event Timeline

As we probably can't easily add ids to the collapsible-content and a connected [[ http://www.heydonworks.com/article/aria-controls-is-poop | aria-controls attribute ]] (which has been stated to be dysfunctional in several readers at 2016), we should nonetheless add aria-expanded attribute to provide direct feedback on the button about its state apart from showing and hiding text content in DOM afterwards.
In this way, we provide a second, label-independent, standard feedback to screen readers.

Most recent major collapsible refactor took place in T42812.

Volker_E renamed this task from Collapsible OOUI form state should be clearer exposed to screen readers to Collapsible HTMLForm state by jquery.makeCollapsible should be clearer exposed to screen readers.May 15 2019, 4:20 PM
Volker_E removed a project: OOUI.

Change 513013 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/core@master] Improve collapsible HTMLForm styling (and accessibility, slightly)

https://gerrit.wikimedia.org/r/513013

Change 538136 had a related patch set uploaded (by VolkerE; owner: VolkerE):
[mediawiki/core@master] Add toggleARIA option and functionality

https://gerrit.wikimedia.org/r/538136

Change 538136 merged by jenkins-bot:
[mediawiki/core@master] jquery.makeCollapsible: Add toggleARIA option and enable for plain toggle

https://gerrit.wikimedia.org/r/538136

Volker_E triaged this task as Medium priority.Sep 23 2019, 5:20 PM
Volker_E claimed this task.

With above ARIA option and output added, the technically useful and feasible has been achieved. As stated in this [[ https://www.heydonworks.com/article/aria-controls-is-poop | 2016 article, aria-controls support has been somewhat dissatisfyingly weak ]] and doesn't seem to provide added value for the time being.
The solution on adding aria-expanded now provides feedback that the $toggle is controlling an expandable section and if the section is a (direct) sibling of the toggle, screen readers also expose the relation correctly.

Change 513013 merged by jenkins-bot:
[mediawiki/core@master] Improve collapsible HTMLForm styling (and accessibility, slightly)

https://gerrit.wikimedia.org/r/513013