Skip to content

Commit

Permalink
fix suggest scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
isstuev committed Oct 1, 2023
1 parent 01c7603 commit 31b178c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ui/snippets/searchBar/SearchBarSuggest/SearchBarSuggest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 }`, {
Expand Down

0 comments on commit 31b178c

Please sign in to comment.