File tree 2 files changed +5
-6
lines changed
2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -36,13 +36,12 @@ const SelectionList = (props: SelectionListPropType): JSX.Element => {
36
36
list ?. length > 0 && ( ( hideSelected && list . filter ( ( e ) => ! e . status || e . status === PRODUCT_UNSELECTED_STATUS ) ?. length > 0 ) || ! hideSelected )
37
37
) , [ list ] ) ;
38
38
const searchValue = ( value : string ) : void => {
39
- if ( onSearch ?. name === 'mockConstructor' ) {
40
- const products = [ ...productList ] ;
41
- setList ( products . filter ( ( e ) => e . name . indexOf ( value ) !== - 1 ) ) ;
42
- }
43
- else if ( onSearch ) {
39
+ if ( onSearch ) {
44
40
onSearch ( value ) ;
41
+ return ;
45
42
}
43
+ const products = [ ...productList ] ;
44
+ setList ( products . filter ( ( e ) => e . name . indexOf ( value ) !== - 1 ) ) ;
46
45
}
47
46
48
47
const changeStatus = ( index : number ) : void => {
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ export interface MultiSelectPropType {
3
3
showCheckbox ?: boolean ,
4
4
hideSelected ?: boolean ,
5
5
hideSearch ?: boolean ,
6
- onSearch ?: ( value : string ) => void ,
6
+ onSearch ?( value : string ) : void ,
7
7
setSelectedValues ?: ( values : eachProductType [ ] ) => { } ,
8
8
searchPlaceholder ?: string ,
9
9
zeroState ?: {
You can’t perform that action at this time.
0 commit comments