feat: scroll page to top on VV navigations

This commit is contained in:
Victor Westerlund 2024-12-05 10:42:42 +01:00
parent ff7d4f5397
commit 24d4c9c868

View file

@ -47,4 +47,9 @@ const CLASSNAME_SEARCHBOX_ACTIVE = "searchboxActive";
new vv.Navigation(`/search?q=${event.target.value}`).navigate(searchResultsElement);
}, 100);
});
}
// Scroll page to top on navigation
{
document.addEventListener(vegvisir.Navigation.EVENTS.FINISHED, () => window.scrollTo({top: 0}));
}