Skip to content

Commit

Permalink
scroll to top on any page using saveScrollPosition if no info is saved.
Browse files Browse the repository at this point in the history
  • Loading branch information
kea-roy committed Nov 24, 2024
1 parent ae7f487 commit 58bf7e9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/src/utils/saveScrollPosition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ export const useSaveScrollPosition = (storageKey: string, pathName: string) => {
}
}, 16);
} else {
window.scrollTo({
top: 0,
behavior: 'smooth',
});
window.addEventListener('scroll', handleScroll);
}
};
Expand Down

0 comments on commit 58bf7e9

Please sign in to comment.