JedWatson / JedWatson/react-select

issue with autofocus on selected option in menu

Open
#3,527 4 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

issue/bug-unconfirmed issue/reviewed menu-bug
Dominant language
TypeScript
Stars
28k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

Hello,

I think this example will show more than I can describe:
https://codesandbox.io/s/31r9vrq531?fontsize=14&module=%2Fexample.js

react-select component sets focus perfectly only in the first example,
but when we define options directly to it or recreate value by hand it sets focus on first element.

Why there is a difference?

best regards

Contributor guide

Open the contributing guide

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 the linked CodeSandbox and compare the first example with the cases that pass options directly or recreate value. Trace how react-select handles focus for each case; done means the selected option receives focus consistently in all examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.