Skip to content

Commit d465cd0

Browse files
authored
[filigran-ui] - feat(Multiselect): add the possibility to filter from server side (#287)
1 parent dc9a33e commit d465cd0

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packages/filigran-ui/src/components/clients/multi-select.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ interface MultiSelectFormFieldProps<
4646
options: T[]
4747
keyLabel?: keyof T
4848
keyValue?: keyof T
49+
shouldFilter?: boolean
4950
defaultValue?: string[]
5051
disabled?: boolean
5152
placeholder: string
@@ -67,6 +68,7 @@ const MultiSelectFormField = React.forwardRef<
6768
options,
6869
keyLabel = 'label',
6970
keyValue = 'value',
71+
shouldFilter=true,
7072
defaultValue,
7173
onValueChange,
7274
onInputChange,
@@ -324,7 +326,8 @@ const MultiSelectFormField = React.forwardRef<
324326
className="w-[300px] p-0 drop-shadow-xs"
325327
align="start"
326328
onEscapeKeyDown={() => setIsPopoverOpen(false)}>
327-
<Command onChange={handleSearchInputChange}>
329+
{/*ShouldFilter use to filter on client side or server side*/}
330+
<Command onChange={handleSearchInputChange} shouldFilter={shouldFilter}>
328331
<CommandInput
329332
placeholder="Search..."
330333
onKeyDown={handleInputKeyDown}

0 commit comments

Comments
 (0)