Skip to content

Conversation

@WofWca
Copy link
Member

@WofWca WofWca commented Feb 16, 2025

For react-virtualized lists.

From MDN:

The aria-posinset attribute defines an element's number or position
in the current set of listitems or treeitems
when not all items are present in the DOM.

TODO:

  • Make sure screen readers actually announce these.
    See TODO comment.
    Would applying role="none" to <li>s and role="listitem" to buttons work? I tried it, and the announcer starts announcing "three of eleven" as I focus between the items. But I am not sure if this is the right way. Doesn't this take away the "button" role from the buttons then?
    There is this example of a "Menu Button Pattern" where they set role="none" on <li>s, so this sounds close to truth.
    Another idea is to make these list items "tabs", as we do for "gallery" tabs.
    I guess let's wait for the audit results.
  • Apply to the remaining <lis.

For `react-virtualized` lists.

[From MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-posinset):

> The aria-posinset attribute defines an element's number or position
> in the current set of listitems or treeitems
> when not all items are present in the DOM.

TODO:
- Make sure screen readers actually announce these.
  See TODO comment.
- Apply to the remaining `<li`s.
@WofWca WofWca force-pushed the wofwca/a11y-aria-posinset-react-window branch from 78d5b27 to 771376a Compare February 16, 2025 16:19
WofWca added a commit that referenced this pull request Apr 25, 2025
Due to the usage of a virtualized list,
screen readers would announce an incorrect number of chats
in the chat list, and the positions of individual chats in the list.

Explicitly setting `aria-posinset` and `aria-setsize` should work.

This only handles the chat list and not all the virtualized lists
that we have.

Related:
- bvaughn/react-window#808.
- #4660.
- #5025.
@WofWca
Copy link
Member Author

WofWca commented May 29, 2025

After #4868, this will also need to be done for the gallery.

WofWca added a commit that referenced this pull request Jul 15, 2025
Due to the usage of a virtualized list,
screen readers would announce an incorrect number of chats
in the chat list, and the positions of individual chats in the list.

Explicitly setting `aria-posinset` and `aria-setsize` should work.

This only handles the chat list and not all the virtualized lists
that we have.

Related:
- bvaughn/react-window#808.
- #4660.
- #5025.
WofWca added a commit that referenced this pull request Sep 2, 2025
Due to the usage of a virtualized list,
screen readers would announce an incorrect number of chats
in the chat list, and the positions of individual chats in the list.

Explicitly setting `aria-posinset` and `aria-setsize` should work.

This only handles the chat list and not all the virtualized lists
that we have.

Related:
- bvaughn/react-window#808.
- #4660.
- #5025.
WofWca added a commit that referenced this pull request Sep 2, 2025
Due to the usage of a virtualized list,
screen readers would announce an incorrect number of chats
in the chat list, and the positions of individual chats in the list.

Explicitly setting `aria-posinset` and `aria-setsize` should work.

This only handles the chat list and not all the virtualized lists
that we have.

Related:
- bvaughn/react-window#808.
- #4660.
- #5025.
WofWca added a commit that referenced this pull request Sep 2, 2025
Due to the usage of a virtualized list,
screen readers would announce an incorrect number of chats
in the chat list, and the positions of individual chats in the list.

Explicitly setting `aria-posinset` and `aria-setsize` should work.

This only handles the chat list and not all the virtualized lists
that we have.

Related:
- bvaughn/react-window#808.
- #4660.
- #5025.
@WofWca
Copy link
Member Author

WofWca commented Oct 18, 2025

Let's convert this into an issue: #5574.

#5044 did a part of the job.

@WofWca WofWca closed this Oct 18, 2025
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.

2 participants