diff --git a/components/tools/ToolDashboard.js b/components/tools/ToolDashboard.js index 5d93d55b188b..663d97890280 100644 --- a/components/tools/ToolDashboard.js +++ b/components/tools/ToolDashboard.js @@ -48,6 +48,18 @@ export default function ToolDashboard() { }, 1000); }, []); + // useEffect to scroll particular div into view + useEffect(() => { + setTimeout(() => { + const path = router?.asPath + const id = path?.slice(path?.indexOf("#") + 1).replace("%20", " ") + const element = document.getElementById(id) + if (element) { + element.scrollIntoView({ behavior: 'smooth', block: "nearest", inline: "nearest" }) + } + }, 1000) + }, []) + // useEffect function to enable the close Category dropdown Modal feature when clicked outside of the modal useEffect(() => { const checkIfClickOutside = (e) => { diff --git a/components/tools/ToolsList.js b/components/tools/ToolsList.js index 048c7acc2c32..f4f4bdbcdccf 100644 --- a/components/tools/ToolsList.js +++ b/components/tools/ToolsList.js @@ -6,7 +6,7 @@ export default function toolsList({ toolsData }) {