Commit c4bcba60 authored by Igor Stuev's avatar Igor Stuev Committed by GitHub

Merge pull request #1242 from blockscout/fix-suggest-scroll

fix suggest scroll
parents c8c811cc 31b178cc
...@@ -86,6 +86,10 @@ const SearchBarSuggest = ({ query, searchTerm, onItemClick, containerId }: Props ...@@ -86,6 +86,10 @@ const SearchBarSuggest = ({ query, searchTerm, onItemClick, containerId }: Props
return map; return map;
}, [ query.data, marketplaceApps.displayedApps ]); }, [ 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) => () => { const scrollToCategory = React.useCallback((index: number) => () => {
setTabIndex(index); setTabIndex(index);
scroller.scrollTo(`cat_${ index }`, { scroller.scrollTo(`cat_${ index }`, {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment