microsoft / fluentui

Fluent UI web represents a collection of utilities, React components, and web components for building web applications.
https://react.fluentui.dev
Other
18.05k stars 2.69k forks source link

[Accessibillity] List Component sets role to 'list' for empty lists #8206

Closed preetriti1 closed 5 years ago

preetriti1 commented 5 years ago

Environment Information

Please provide a reproduction of the bug in a codepen:

https://codepen.io/preetriti1/pen/moOzVg

Actual behavior:

List component have role set to 'list' when there are no items in the list. When aria-role is set to 'list' it expects a childrole which is absent in case of empty lists.

Expected behavior:

The div rendering the list should not have the role set to 'list' when there are no items in the list to render.

Priorities and help requested:

Are you willing to submit a PR to fix? No

Requested priority: Normal

Products/sites affected: Azure LogicApps accessibility

KevinTCoughlin commented 5 years ago

This accessibility issue looks to be valid given the w3 ARIA spec, specifically the Required Owned Elements section quoted below for role="list":

Lists contain children whose role is listitem, or elements whose role is group which in turn contains children whose role is listitem. https://www.w3.org/WAI/PF/aria/roles#list

Should be a straightforward fix @aftab-hassan.

cc: @natalieethell

msft-github-bot commented 5 years ago

:tada:This issue was addressed in #8337, which has now been successfully released as office-ui-fabric-react@v6.159.1.:tada:

Handy links: