File tree Expand file tree Collapse file tree
client/src/app/pages/search/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -163,14 +163,17 @@ export const SearchMenu: React.FC<ISearchMenu> = ({ onChangeSearch }) => {
163163 // Search value initial value
164164 const { tableControls : sbomTableControls } =
165165 React . useContext ( SbomSearchContext ) ;
166- const initialSearchValue =
167- sbomTableControls . filterState . filterValues [ FILTER_TEXT_CATEGORY_KEY ] ?. [ 0 ] ||
168- "" ;
169166
170167 // Search value
171- const [ searchValue , setSearchValue ] = React . useState ( initialSearchValue ) ;
168+ const [ searchValue , setSearchValue ] = React . useState ( "" ) ;
172169 const [ isSearchValueDirty , setIsSearchValueDirty ] = React . useState ( false ) ;
173170
171+ React . useEffect ( ( ) => {
172+ const searchValueFromTableControls =
173+ sbomTableControls . filterState . filterValues [ FILTER_TEXT_CATEGORY_KEY ] ?. [ 0 ] ;
174+ setSearchValue ( searchValueFromTableControls ?? "" ) ;
175+ } , [ sbomTableControls . filterState ] ) ;
176+
174177 // Debounce Search value
175178 const [ debouncedSearchValue , setDebouncedSearchValue ] = useDebounceValue (
176179 searchValue ,
You can’t perform that action at this time.
0 commit comments