JedWatson / JedWatson/react-select
Focus state not updated after selected a value, when using Components
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 28k
- Forks
- 4.1k
- PR merge metrics
- No merged PRs in 30d
Description
Hi. I've found that when you use components (not all), if you select a value, then click anywhere to "blur" the select, it won't remove the focus state.
I've managed to reproduce it: https://codesandbox.io/s/musing-mcnulty-o4rz92?file=/src/App.tsx

In my 4 examples :
- no components
- IndicatorSeparator
- SelectContainer (❌ doesn't work)
- Control (❌ doesn't work)
The minimal failing code would be:
<Select
value={currentLetter}
options={letters}
onChange={(option) => setCurrentLetter(option || undefined)}
components={{
SelectContainer: (p) => <components.SelectContainer {...p} />
}}
/>
In my real project, I'm using a custom Control to add elements before the input + classNames. And now I can't get the focus state to go off.
Does anyone have an idea about that?
Thanks.
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
Reproduce the issue using the linked CodeSandbox and the minimal Select example with custom SelectContainer or Control components. Compare the focus behavior across the listed component variants; done means selecting a value and clicking elsewhere removes the focus state consistently.
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
- Clearly specified
- Newbie friendliness
- 35/100