diff --git a/src/components/navigator/NavigatorView.tsx b/src/components/navigator/NavigatorView.tsx index 9b3ae5eb..dcc2f9eb 100644 --- a/src/components/navigator/NavigatorView.tsx +++ b/src/components/navigator/NavigatorView.tsx @@ -24,6 +24,7 @@ export const NavigatorView: FC<{}> = props => const [ needsSearch, setNeedsSearch ] = useState(false); const { searchResult = null, topLevelContext = null, topLevelContexts = null, navigatorData = null } = useNavigator(); const pendingSearch = useRef<{ value: string, code: string }>(null); + const elementRef = useRef(); useRoomSessionManagerEvent(RoomSessionEvent.CREATED, event => { @@ -158,6 +159,8 @@ export const NavigatorView: FC<{}> = props => if(!searchResult) return; setIsLoading(false); + + if(elementRef && elementRef.current) elementRef.current.scrollTop = 0; }, [ searchResult ]); useEffect(() => @@ -214,7 +217,7 @@ export const NavigatorView: FC<{}> = props => { !isCreatorOpen && <> - + { (searchResult && searchResult.results.map((result, index) => )) } } diff --git a/src/components/navigator/views/search/NavigatorSearchResultView.tsx b/src/components/navigator/views/search/NavigatorSearchResultView.tsx index 143c3435..a85daaca 100644 --- a/src/components/navigator/views/search/NavigatorSearchResultView.tsx +++ b/src/components/navigator/views/search/NavigatorSearchResultView.tsx @@ -13,7 +13,6 @@ export interface NavigatorSearchResultViewProps extends AutoGridProps export const NavigatorSearchResultView: FC = props => { const { searchResult = null, ...rest } = props; - const [ isExtended, setIsExtended ] = useState(true); const [ displayMode, setDisplayMode ] = useState(0); @@ -44,7 +43,7 @@ export const NavigatorSearchResultView: FC = pro //setIsExtended(searchResult.closed); setDisplayMode(searchResult.mode); - }, [ searchResult,props ]); + }, [ searchResult ]); const gridHasTwoColumns = (displayMode >= NavigatorSearchResultViewDisplayMode.THUMBNAILS);