onBlur never called when parent has been focused
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- react, typescript
- Domain
- frontend
Research direction
Start by reproducing the focus sequence with the provided parent div and ReactSelect snippet, then trace the component's onBlur and onMenuClose handling. Done means clicking outside after the parent has been focused triggers onBlur and closes the option menu without the unexpected initial onMenuClose call.
Written by the indexing model from the issue text.
Description
Hi,
When the parent element of a ReactSelect has been focused, the onBlur is never called on ReactSelect, so clicking outside of the component never close the option menu.
It can be reproduced easily with this:
const nodeRef = useRef<HTMLDivElement | null>(null);
<div
ref={nodeRef}
tabIndex={0}
onMouseDown={() => {
nodeRef.current?.focus();
}}
>
<ReactSelect />
</div>
Another strange thing is that in this situation, onMenuClose is called when we open the menu for the first time, and it's not the case in regular situations.
Thanks,
- Dominant language
- TypeScript
- Stars
- 28k
- Forks
- 4.1k
- PR merge metrics
- No merged PRs in 30d
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.
More from JedWatson/react-select
-
issue/bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
JedWatson/react-select#5856 · 3 comments · 1 reaction ·
-
issue/bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
JedWatson/react-select#5812 ·
-
issue/bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
JedWatson/react-select#4969 · 1 comment ·
-
issue/bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
JedWatson/react-select#6094 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
JedWatson/react-select#6093 ·
All issues in JedWatson/react-select
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
fullcalendar/fullcalendar#8106 ·