diff --git a/src/lib/multi-select/SelectionList.tsx b/src/lib/multi-select/SelectionList.tsx index b33a5ce..9c585e5 100644 --- a/src/lib/multi-select/SelectionList.tsx +++ b/src/lib/multi-select/SelectionList.tsx @@ -36,13 +36,12 @@ const SelectionList = (props: SelectionListPropType): JSX.Element => { list?.length > 0 && ((hideSelected && list.filter((e) => !e.status || e.status === PRODUCT_UNSELECTED_STATUS)?.length > 0) || !hideSelected) ), [list]); const searchValue = (value: string): void => { - if (onSearch?.name === 'mockConstructor') { - const products = [...productList]; - setList(products.filter((e) => e.name.indexOf(value) !== -1)); - } - else if (onSearch) { + if (onSearch) { onSearch(value); + return; } + const products = [...productList]; + setList(products.filter((e) => e.name.indexOf(value) !== -1)); } const changeStatus = (index: number): void => { diff --git a/src/lib/multi-select/types.d.ts b/src/lib/multi-select/types.d.ts index 922ba40..0cda28f 100644 --- a/src/lib/multi-select/types.d.ts +++ b/src/lib/multi-select/types.d.ts @@ -3,7 +3,7 @@ export interface MultiSelectPropType { showCheckbox?: boolean, hideSelected?: boolean, hideSearch?: boolean, - onSearch?: (value: string) => void, + onSearch?(value: string): void, setSelectedValues?: (values: eachProductType[]) => {}, searchPlaceholder?: string, zeroState?: {