fix combobox filter

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-07-21 12:00:52 +02:00
parent 043bd67a49
commit ba381636a0

View File

@@ -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"