WCAG 4.1.2 A: Link does not convey expanded state (Issue 35) #358
Labels
A11y
Issue is related to accessibility
Core CivicTheme
Core CivicTheme issue
State: Done
The issue is complete and waiting for a release
Type: Defect
Issue is a defect
Summary
Via Vision Australia assessment: August 2024
Impact: medium
Note: DTA have a 90 day remediation period to address the identified issues within the audit, all issues must be resolved to obtain WCAG 2.2 certification for digital.gov.au
Steps to reproduce
Global issue – Main navigation
digital.gov.au beta | digital.gov.au (https://www.digital.gov.au)
Observed outcome
When the "Explore" link in the main navigation is triggered, a sub-navigation list is expanded. While this expanded state is visually apparent, it is not conveyed to assistive technologies when it is first triggered.
The aria-expanded attribute is dynamically added after the element has been triggered.
This issue occurs on all pages when the navigation link is in its default state (i.e. a user has not yet interacted with the link).
Code used
Default state
Expanded state
Why this matters
Screen reader users may not realise that the link has triggered additional content when they first interact with it, and may not understand what state it is in.
They may struggle to successfully interact with the component.
Expected outcome
Ensure that the state of the link is available to assistive technologies at all times. To achieve this, the aria-expanded attribute should be present on the element on page load:
• The value should be "false" when the link is in its default state of collapsed and dynamically updated to "true" when expanded.
• Preferably, add the aria-controls attribute to the link. Match its value to the id attribute of the element that contains the expandable content.
Ideally, reimplement the trigger as a semantic element. When screen reader users encounter a button, they expect it to trigger functionality (rather than navigate somewhere, as is the expectation of a link), making its purpose clearer.
Code example
The text was updated successfully, but these errors were encountered: