Skip to content

[accessibility] OptionList shows incorrect count during keyboard navigation. #707

Description

@rynodivino

Description

When using the keyboard to traverse an optionlist, the length of the list is always restricted to 3 or less. I think it's related to this:
https://github.com/react-component/select/blob/master/src/OptionList.tsx#L255-L257

The only thing rendered is the current active plus next and previous items. Nice way to keep things light for sure, but it would be nice if there is a way to convey the length of the options to the screenreader correctly.

I also noticed issues #473 and #474, but did not see any mention of this specific issue in either (unless i just missed the essence of those issues).

Screenshot

rc-select-a11y

Steps to reproduce

  1. Navigate to https://rc-select.react-component.vercel.app/?path=/story/rc-select--optionlabelprop
  2. Tab (or click) to input, to show options
  3. Use arrow keys to cycle through the list

Expected behavior

The screenreader should announce each option item's value, selected state, and position in the list (i.e. 9 not selected 9 of 9)

Actual behavior

The option's position in the list is always restricted to a count of 3 or less (i.e. 9 not selected 2 of 3)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions