'React select autocomplete search doesn't work
I'm using react select and i want to display in options icons ,But the search doesn't anymore work. In my list options i have orange but when i write orange in the select, return no options.
<Select
placeholder="Select option"
value={selectedOption}
options={list?.map((e) => ({
...e,
value: e?.id,
label: e?.name,
icon: (
<div>
<img
style={{
height: "40px",
width: "50px",
// borderRadius: "100%",
}}
src={e?.icon}
/>
</div>
),
}))}
isClearable={true}
onChange={handleChange}
name="option"
getOptionLabel={(e) => {
return (
<div
style={{
display: "flex",
alignItems: "center",
}}
>
{e.icon}
<span style={{ marginLeft: 5 }}>
{e.label}
</span>
</div>
);
}}
/>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
