diff --git a/frontend/src/pages/posts/PostHistoryPage.tsx b/frontend/src/pages/posts/PostHistoryPage.tsx index 3fd444e..dbf65dc 100644 --- a/frontend/src/pages/posts/PostHistoryPage.tsx +++ b/frontend/src/pages/posts/PostHistoryPage.tsx @@ -1,4 +1,5 @@ import { useQuery } from '@tanstack/react-query' +import { useEffect } from 'react' import { Helmet } from 'react-helmet-async' import { useLocation } from 'react-router-dom' @@ -31,6 +32,10 @@ export default (() => { const changes = data?.changes ?? [] const totalPages = data ? Math.ceil (data.count / limit) : 0 + useEffect (() => { + document.querySelector ('table')?.scrollIntoView ({ behavior: 'smooth' }) + }, [location.search]) + return ( diff --git a/frontend/src/pages/posts/PostSearchPage.tsx b/frontend/src/pages/posts/PostSearchPage.tsx index 35b7f63..9d9c825 100644 --- a/frontend/src/pages/posts/PostSearchPage.tsx +++ b/frontend/src/pages/posts/PostSearchPage.tsx @@ -85,7 +85,7 @@ export default (() => { setUpdatedFrom (qUpdatedFrom) setUpdatedTo (qUpdatedTo) - document.getElementsByTagName ('main')![0].scroll (0, 0) + document.querySelector ('table')?.scrollIntoView ({ behavior: 'smooth' }) }, [location.search]) const search = async () => {