Page MenuHomePhabricator

Add missing aria role to "no results found" slot of Lookup component
Closed, ResolvedPublic1 Estimated Story Points

Description

The "no results found" slot of the Lookup component is an li tag inside a ul. The ul is marked with the aria role listbox, but the li lacks any role. This is (according to cypress-axe) not aria-conformant.

Add the option role to the li, so that the listbox has an option child, and that the li has a semantic role.

Example cypress-axe output:

┌─────────┬──────────────────────────┬────────────┬───────────────────────────────────────────────────────────────────────────┬───────┐
│ (index) │            id            │   impact   │                                description                                │ nodes │
├─────────┼──────────────────────────┼────────────┼───────────────────────────────────────────────────────────────────────────┼───────┤
│    0    │ 'aria-required-children' │ 'critical' │ 'Ensure elements with an ARIA role that require child roles contain them' │   1   │
│    1    │        'listitem'        │ 'serious'  │               'Ensure <li> elements are used semantically'                │   1   │
└─────────┴──────────────────────────┴────────────┴───────────────────────────────────────────────────────────────────────────┴───────┘

Event Timeline

Change #1076719 had a related patch set uploaded (by Arthur taylor; author: Arthur taylor):

[design/codex@main] Add aria-role to empty lookup result item

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

Example HTML generated by current implementation:

2024-09-27-125220_574x80_scrot.png (80×574 px, 9 KB)

CCiufo-WMF triaged this task as Medium priority.Sep 30 2024, 5:14 PM
CCiufo-WMF set the point value for this task to 1.
CCiufo-WMF moved this task from Inbox to Up Next on the Design-System-Team board.

Change #1076719 merged by jenkins-bot:

[design/codex@main] Lookup: Add ARIA `role`` to no result Lookup item

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

Change #1080747 had a related patch set uploaded (by LWatson; author: LWatson):

[mediawiki/core@master] Update Codex from v1.13.1 to v1.14.0

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

Change #1080747 merged by jenkins-bot:

[mediawiki/core@master] Update Codex from v1.13.1 to v1.14.0

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

(restoring assignee after column trigger unintentionally cleared it)