JedWatson / JedWatson/react-select
First attempt of opening the dropdown the highlight falls on first option and not the selected value
Open
Nobody has claimed this yet.
issue/bug-unconfirmed
- Dominant language
- TypeScript
- Stars
- 28k
- Forks
- 4.1k
- PR merge metrics
- No merged PRs in 30d
Description
Is it possible to set initially selectedOption (using selectedValue maybe, if it is defined) as lastFocusedOption and then only options[0]?
Something like
return lastFocusedOption && options.indexOf(lastFocusedOption) > -1
? lastFocusedOption
: selectedOption || options[0];

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the dropdown focus logic that uses lastFocusedOption, selectedOption, and options. Reproduce the first-open behavior, then verify that an initially selected option receives the highlight while options[0] remains the fallback when no selected option is available.
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
- 45/100