bvaughn / react-window

React components for efficiently rendering large lists and tabular data
https://react-window.now.sh/
MIT License
15.72k stars 782 forks source link

Fix ARIA violation: add innerElementRole property #631

Closed jussirantala closed 3 weeks ago

jussirantala commented 2 years ago

innerElementRole property added for the user to be able to set role. Without this it is not possible to pass ARIA violation checks. For example you could set innerElementRole to "rowgroup" and role for each list item to "row" and the screen reader would understand that this is list.

Terence-Cheng commented 2 years ago

I also had this problem, but I solve it with innerElementType like below.

        <List
            innerElementType={(innerProps) => (
                <div
                    {...innerProps}
                    role="rowgroup"
                />
            )}

      ....