JedWatson / JedWatson/react-select
Clicking outside of the menu does not close a controlled menu
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 28k
- Forks
- 4.1k
- PR merge metrics
- No merged PRs in 30d
Description
I'm using this example to use a controlled select component.
https://github.com/JedWatson/react-select/blob/master/docs/examples/ControlledMenu.tsx
The menu does not close when clicking outside of the menu. I can see the browser that the document.activeElement is just the body of the page. I've tried setting focus to the select component on menu open so that I can hook into the onBlur but the body of the page is still focused.
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 with docs/examples/ControlledMenu.tsx and reproduce the controlled select behavior described in the issue, especially after clicking outside the menu when document.activeElement is the page body. Trace the menu's outside-click and focus handling; done means the controlled menu closes reliably when focus or clicks move outside it.
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