JedWatson / JedWatson/react-select

Async multiselect component list not closing when clicking outside of the component

Open
#5,086 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

awaiting-author-response issue/bug-unconfirmed
Dominant language
TypeScript
Stars
28k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

Hi.

I am trying to fix a bug on my website; when I select multiple users from the async select component I am not able to close the component by selecting elsewhere on the page. The only way to close to the component is by selecting itself, otherwise, the dropdown stays open.

See example here

It's difficult to share the code as this is a complex app. However it will help to know that I am defining a custom Async component with these props:

<SelectAsync
  disabled={choice === CHOICES.broadcast}
  loadOptions={onLoadUsers}
  additional={{ page: 1 }}
  multiselect={true}
  closeOnSelect={false}
  onChange={handleChangeSelect}
  placeholder="Select contact(s) ..."
  inputPrefix="To:"
  value={selected}
/>

I know it will be hard to debug without the source code, but any ideas as to why the component is staying open that would be great.

Thanks

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 with the SelectAsync usage and linked Loom reproduction, focusing on async multiselect behavior when closeOnSelect={false}. Reproduce the case by selecting multiple users and clicking elsewhere on the page; done means the dropdown closes without requiring another click on the component.

Written by the indexing model from the issue text.

Assessment

Tech stack
react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.