JedWatson / JedWatson/react-select

__isNew__ options always showing even when filtering

Open
#4,902 10 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?

In V5 using creatable and filterable options, when an option has __isNew__: true it will always show in the options, even when filtering.

This issue didn't exist in v4, and there is no mention of it in the changelog.

This issue is caused by this line:
https://github.com/JedWatson/react-select/blob/cfd5d9f632b4a8b699fba1028d3243735428e428/packages/react-select/src/filters.ts#L28

Was introduce by this PR: https://github.com/JedWatson/react-select/pull/4702
Which doesn't mention this being an indented behaviour.

Video:
https://www.loom.com/share/e343c5d9770544c398a3c3d5537c649d

See this video of the difference between React-Select 4 and 5.
https://www.loom.com/share/9c7aff61336a475398750539200957a7

Codesandbox:
https://codesandbox.io/s/codesandboxer-example-forked-o2wlz?file=/example.tsx

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 packages/react-select/src/filters.ts at the linked line and reproduce the behavior using the provided CodeSandbox. Compare filtering in versions 4 and 5, then verify that an option with isNew: true follows the expected filtering behavior while using creatable and filterable options.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.