File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 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 => {
3636 list ?. length > 0 && ( ( hideSelected && list . filter ( ( e ) => ! e . status || e . status === PRODUCT_UNSELECTED_STATUS ) ?. length > 0 ) || ! hideSelected )
3737 ) , [ list ] ) ;
3838 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 ) {
4440 onSearch ( value ) ;
41+ return ;
4542 }
43+ const products = [ ...productList ] ;
44+ setList ( products . filter ( ( e ) => e . name . indexOf ( value ) !== - 1 ) ) ;
4645 }
4746
4847 const changeStatus = ( index : number ) : void => {
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ export interface MultiSelectPropType {
33 showCheckbox ?: boolean ,
44 hideSelected ?: boolean ,
55 hideSearch ?: boolean ,
6- onSearch ?: ( value : string ) => void ,
6+ onSearch ?( value : string ) : void ,
77 setSelectedValues ?: ( values : eachProductType [ ] ) => { } ,
88 searchPlaceholder ?: string ,
99 zeroState ?: {
You can’t perform that action at this time.
0 commit comments