From 31b178cc7a0253c51554c0f37011876d254d7c7f Mon Sep 17 00:00:00 2001 From: isstuev Date: Sun, 1 Oct 2023 19:04:22 +0200 Subject: [PATCH] fix suggest scroll --- ui/snippets/searchBar/SearchBarSuggest/SearchBarSuggest.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/snippets/searchBar/SearchBarSuggest/SearchBarSuggest.tsx b/ui/snippets/searchBar/SearchBarSuggest/SearchBarSuggest.tsx index 68354677d7..0704d04228 100644 --- a/ui/snippets/searchBar/SearchBarSuggest/SearchBarSuggest.tsx +++ b/ui/snippets/searchBar/SearchBarSuggest/SearchBarSuggest.tsx @@ -86,6 +86,10 @@ const SearchBarSuggest = ({ query, searchTerm, onItemClick, containerId }: Props return map; }, [ query.data, marketplaceApps.displayedApps ]); + React.useEffect(() => { + categoriesRefs.current = Array(Object.keys(itemsGroups).length).fill('').map((_, i) => categoriesRefs.current[i] || React.createRef()); + }, [ itemsGroups ]); + const scrollToCategory = React.useCallback((index: number) => () => { setTabIndex(index); scroller.scrollTo(`cat_${ index }`, {