Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: a11y: add aria-posinset for virtualized #4660

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

WofWca
Copy link
Collaborator

@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
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.

1 participant