From d3ee18e2a1eaa636eca4bf7c34d6349ab6b6403c Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Fri, 29 Mar 2024 21:18:31 +0000 Subject: [PATCH] Reset scroll on active group change --- src/components/Roadmaps/RoadmapsPage.tsx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/components/Roadmaps/RoadmapsPage.tsx b/src/components/Roadmaps/RoadmapsPage.tsx index 4a29e9956..e74f69af1 100644 --- a/src/components/Roadmaps/RoadmapsPage.tsx +++ b/src/components/Roadmaps/RoadmapsPage.tsx @@ -392,12 +392,6 @@ export function RoadmapsPage() { const [isFilterOpen, setIsFilterOpen] = useState(false); - useEffect(() => { - if (!isFilterOpen) { - document?.getElementById('filter-button')?.bringIntoView(); - } - }, [isFilterOpen]); - useEffect(() => { if (!activeGroup) { setVisibleGroups(allGroups); @@ -475,6 +469,7 @@ export function RoadmapsPage() { onClick={() => { setActiveGroup(group.group); setIsFilterOpen(false); + document?.getElementById('filter-button')?.scrollIntoView(); }} category={group.group} selected={activeGroup === group.group}