[beta4] Accessibility issues in header modals (id/aria-labelledby, button title)

Created on 18 August 2023, about 1 year ago
Updated 18 September 2023, about 1 year ago

Problem/Motivation

The header pattern handles modals for mobile search and menu.
These modals have currently some accessibility issues :
- the search modal doesn't have an accessible name (necessary for assistive technologies like screen readers)
- the "open" button for the menu has an erroneous aria-haspopup="menu" : this attribute is not mandatory, but if present, it should be "dialog" (a "menu" here doesn't mean a website navigation, but more like a native application menu, which is not our case)
- the "close" buttons have the same text/title, which makes them not explicit enough (and also the title attribute should be used only to complement the button text, it has no use if it's a simple repeat)

Steps to reproduce

Populate the header pattern with a search bar.
On a small window or mobile phone, navigate the header with a screenreader, or "inspect accessibility properties".
Open the search modal : it says only "dialog" (contrary to the menu modal which says "menu"), its accessible name is "null".
Tabulate to the close button : it says only "close", its accessible name is "close", as is its inside text.
The problem is the same for the close button in the menu modal.

Proposed resolution

Add an id attribute on the opening button of the search modal, and an aria-labelledby attribute on the search modal to point on that id, so that the button text ("Search") is use as the modal name (same technique used currently for the menu modal).
Modify/add the aria-haspopup attribute on the "open" buttons so that it indicates "dialog", or delete it.
Modify the title attributes on the "close" buttons so that they have each their own, and complement their inside text : "Close search" and "Close menu".

๐Ÿ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

๐Ÿ‡ซ๐Ÿ‡ทFrance mh_nichts

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024