fix combobox filter
This commit is contained in:
@@ -100,7 +100,7 @@ export function Combobox<T extends string>({
|
|||||||
align={align}
|
align={align}
|
||||||
portal={portal}
|
portal={portal}
|
||||||
>
|
>
|
||||||
<Command>
|
<Command shouldFilter={false}>
|
||||||
{searchable === true && (
|
{searchable === true && (
|
||||||
<CommandInput
|
<CommandInput
|
||||||
placeholder="Search item..."
|
placeholder="Search item..."
|
||||||
@@ -125,7 +125,10 @@ export function Combobox<T extends string>({
|
|||||||
)}
|
)}
|
||||||
<VirtualList
|
<VirtualList
|
||||||
height={300}
|
height={300}
|
||||||
data={items}
|
data={items.filter((item) => {
|
||||||
|
if (search === '') return true;
|
||||||
|
return item.label.toLowerCase().includes(search.toLowerCase());
|
||||||
|
})}
|
||||||
itemHeight={32}
|
itemHeight={32}
|
||||||
itemKey="value"
|
itemKey="value"
|
||||||
className="min-w-60"
|
className="min-w-60"
|
||||||
|
|||||||
Reference in New Issue
Block a user