Skip to content

Component behaves differently to native <select>, causing accessibility issues #1

@matteason

Description

@matteason

Ideally custom select components should behave as closely as possible to a native <select> to allow users of assistive technology to interact with them in the way they're used to. There are some differences between this component and a native select that are likely to cause accessibility issues, for example:

  • The label exposed via aria-label isn't the same as the visual label above the input. The visual label should be duplicated in aria-label and the placeholder should probably be in aria-description
  • The dropdown expands automatically if you use the tab key to navigate to it. A native select would only expand on certain keyboard events (see the WAI example below)
  • Previous dropdowns stay open when using the tab key to navigate to the next one: Three country selectors with their dropdown lists overlapping
  • The options dropdown itself is focusable. Focus should remain on the parent.
  • Navigating the results list with arrow keys and a screen reader results in the screen reader reading 'blank' for each option, meaning the user won't know what they're selecting

There's a good coded up example of a custom editable selector at https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-autocomplete-list/. If you'd like to test the component with a screen reader, NVDA is free and widely used

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions