Skip to content

New room list: improve list accessibility#29430

Closed
florianduros wants to merge 6 commits into
developfrom
florianduros/new-room-list/accessibility-list
Closed

New room list: improve list accessibility#29430
florianduros wants to merge 6 commits into
developfrom
florianduros/new-room-list/accessibility-list

Conversation

@florianduros
Copy link
Copy Markdown
Member

@florianduros florianduros commented Mar 5, 2025

Task #29368
#29368 introduced a new room list with accessibility drawbacks. The list was using accessibility roles related to grid instead of listbox.

bvaughn/react-virtualized#1657 gives a good summary of the situation some years ago. The missing roles in the issues have been fixed since but react-virtualized sticks with grid role instead of listbox.

This PR aims to replace the a11y roles. Sadly, we need to mutate one node rendered by react-virtualized in order to fully migrate to listbox.

NB: the aria-selected attribute is always set to false because the view model of the room list doesn't return yet the current selected room. It will change in the following week/days.

Before After
image image

@florianduros florianduros changed the title chore: make the room list panel a flexbox New room list: improve list accessibility Mar 5, 2025
@florianduros florianduros force-pushed the florianduros/new-room-list/accessibility-list branch from f2edcd3 to 7c6b2e6 Compare March 6, 2025 08:42
@florianduros florianduros force-pushed the florianduros/new-room-list/accessibility-list branch 2 times, most recently from d998e51 to 9699e65 Compare March 6, 2025 09:13
@florianduros florianduros force-pushed the florianduros/new-room-list/accessibility-list branch from 9699e65 to e484be8 Compare March 6, 2025 10:01
Base automatically changed from florianduros/new-room-list/fist-step-list to develop March 6, 2025 10:15
Copy link
Copy Markdown
Member

@dbkr dbkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit grim - what's our route out of this? Is there a bug for react-virtualized to use the right roles? It not setting aria-setsize seems like a fairly uncontroversial bug?

@florianduros
Copy link
Copy Markdown
Member Author

florianduros commented Mar 7, 2025

@dbkr

https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-setsize aria-setsize is not for grid and react-virtualized uses grid role. BUT I made an error on putting in on the list instead of each item (will fix it and add aria-posinset too).

With the current role of react-virtualized, it's kind of accessible but not in the best way. It seems that accessibility is not their primary concern (https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/gridcell_role#gridcells_with_dynamically_added_hidden_or_removed_rows_and_columns not using aria-colindex for example).

@MidhunSureshR
Copy link
Copy Markdown
Member

Looking at https://www.w3.org/WAI/ARIA/apg/patterns/listbox/:

In addition, the interaction model conveyed by the listbox role to assistive technologies does not support interacting with elements inside of an option. Because of these traits of the listbox widget, it does not provide an accessible way to present a list of interactive elements, such as links, buttons, or checkboxes. To present a list of interactive elements, see the Grid Pattern.

Does this mean that we shouldn't have buttons inside a listbox?

Also https://www.w3.org/WAI/ARIA/apg/patterns/grid/examples/layout-grids/ sounds like it does what we want? I think whatsapp web is using this exact role.

@florianduros
Copy link
Copy Markdown
Member Author

florianduros commented Mar 7, 2025

Oh interesting @MidhunSureshR thanks.

It means that the list with its current grid role is already following the best practice. We have a similar implementation of the example 1 https://www.w3.org/WAI/ARIA/apg/patterns/grid/examples/layout-grids/

Closing the PR then.

@florianduros florianduros deleted the florianduros/new-room-list/accessibility-list branch September 3, 2025 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants