JedWatson / JedWatson/react-select

search value reset's on item select from dropdown

Open
#5,361 2 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

Are you reporting a bug or runtime error?

Bug

The following CSB link can be used to reproduce the issue or at least the behavior.
https://codesandbox.io/s/react-select-v5-sandbox-y5jtm

Steps to reproduce

  1. Type in some text to search.
  2. user observes 3-4 items from search results.
  3. user selects one item from the results
  4. the search keyword disappears
  5. dropdown items reset

Expected result

Upon selecting an item from the search results, the search keyword and search result should persist so the user doesn't have to click, type, select again from the list

Are there any props or tricks in callbacks that can help retain search keywords and search results after the user selects an item from the dropdown?

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 reproducing the behavior in the linked CodeSandbox: type a search term, select a result, and observe the cleared keyword and reset options. Trace the React Select selection and search-input behavior to determine how the search state is handled. Done means selecting an item preserves the search keyword and displayed results as described.

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.