Skip to content

Commit

Permalink
Scroll up after dynamic reload
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinborner committed Sep 28, 2024
1 parent 5ba313b commit 1095e84
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ function addLinkListeners() {
link.addEventListener("click", (e) => {
e.preventDefault();
loadPage(link.getAttribute("href"), () => {
window.scrollTo({ top: 0, behavior: 'smooth' });
initDOM();
addLinkListeners();
});
Expand Down

0 comments on commit 1095e84

Please sign in to comment.