JedWatson / JedWatson/react-select
React select `Create "New Option"` does not show up when using `getOptionLabel` and `getOptionValue`
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 28k
- Forks
- 4.1k
- PR merge metrics
- No merged PRs in 30d
Description
Hello React Select Team,
I'm using react-select/creatable to create new options, when user enters new key options. Also i have getOptionLabel and getOptionValue to show and accept different value other than label and value coming from colourOptions array
<CreatableSelect
classNamePrefix="select"
onCreateOption={(val) => handleCreate(val)}
name="color"
getOptionLabel={(option) => option._id || ""}
getOptionValue={(option) => option._id || ""}
options={colourOptions}
/>
The problem is, i'm unable to see Create "New Option" as an option to create the dropdown value, Instead i'm seeing a blank row without the text.
I have created a working flow for this issue ( Code Sandbox Link ).
Please let me know what fixes do we have for this issue. Thanks
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 by running the linked CodeSandbox reproduction and inspect the react-select/creatable CreatableSelect flow with the shown getOptionLabel and getOptionValue callbacks. Confirm the blank row occurs when entering a new option, then verify that the create option displays “Create "New Option"” while custom option labels and values still work.
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