JedWatson / JedWatson/react-select

First attempt of opening the dropdown the highlight falls on first option and not the selected value

Open
#5,350 0 comments 0 reactions 0 assignees View on GitHub

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];
image

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.