From e03d7f2969b289bd278d454bcb501856628b1fc9 Mon Sep 17 00:00:00 2001 From: ilia Date: Sat, 22 Oct 2022 20:03:14 +0300 Subject: [PATCH] remove bug with text --- сomponents/search/index.tsx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/сomponents/search/index.tsx b/сomponents/search/index.tsx index be14801..a9fa95c 100644 --- a/сomponents/search/index.tsx +++ b/сomponents/search/index.tsx @@ -53,14 +53,27 @@ export const Search: React.FC<{onData:(data:any)=>void}> = (props) =>{ } const onEnter = (value:any) => { - dispatch(search(searchOptions)) + dispatch( + search( + searchOptions.concat( + autoCompleteValue.length ? + [ + { + 'type': 'All', + 'value': autoCompleteValue + + } + ] : [] + ) + ) + ) } return( el.value)} onSelect={onSelect as any} value={autoCompleteValue} - onChange={(e)=>setAutoCompleteValue(e)} + onChange={(e: any)=>setAutoCompleteValue(e)} // onSearch={handleSearch} >