Open arunbs12 opened 11 months ago
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
react-select/creatable
getOptionLabel
getOptionValue
label
value
<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.
Create "New Option"
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
You can add a condition in getOptionLabel
Hello React Select Team,
I'm using
react-select/creatable
to create new options, when user enters new key options. Also i havegetOptionLabel
andgetOptionValue
to show and accept different value other thanlabel
andvalue
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