react-component / react-component/select

Render the listbox whenever the Select component is rendered

Open
#853 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
938
Forks
482
Avg merge
15h 8m
Merged PRs (30d)
2

Description

Description

As it stand right now, the listbox is added to the DOM after the user interacts with the Select component. This is a problem because it will throw an error when running accessibility tests. Listbox is rendered after the user interacts with the component, but this is not good enough.

Technical description of the issue

The problem is that the [role="combobox"] element has aria-controls attribute equal to the id of the [role="listbox"] element, but since this element does not exist when the page is first rendered, it will throw an error when running accessibility audits.

Proposed solution

Allow rendering (at least optionally) the listbox element from the start. You can do this by passing prop 'forceRender={true}' to SelectTrigger in BaseSelect.tsx, and control this with a prop received from Select. I've created a PR for this, but open to suggestion on how it can be done differently.

Thanks!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with BaseSelect.tsx and the proposed PR #804, focusing on SelectTrigger and its forceRender={true} option. The work is done when the listbox can be rendered from the initial Select render and accessibility audits no longer encounter an aria-controls reference to a missing element.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.