mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-08-13 20:54:16 +02:00
Reset scroll on active group change
This commit is contained in:
@@ -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}
|
||||
|
Reference in New Issue
Block a user