Skip to content

Missing props for accessibility #411

Closed

Description

@YuridiaLarios

I am trying to add role="list" to the react-infinite-scroll-component top div so screenreaders can announce how many children are under this list, however there is no way to add it under the existing props so screenreaders cannot announce items inside the infinity scroll list correctly.

Activity

  1. iamdarshshah commented on Jun 6, 2026

    @iamdarshshah
    Collaborator

    Hey @YuridiaLarios, thanks for filing this! The fix shipped in v7.2.1 — you can now pass role, aria-label, aria-labelledby, and any other aria-* attribute directly to the component:

    <InfiniteScroll
      role="list"
      aria-label="Search results"
      ...
    >
      {items.map(item => (
        <div role="listitem" key={item.id}>{item.name}</div>
      ))}
    </InfiniteScroll>

    Thanks to @sayedrisat for picking this up and implementing it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions