From 6ac31eb8e07d6ff9d3dcb1038be5ad9f32e0798f Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 30 Dec 2021 20:20:19 +0000 Subject: [PATCH] Clear hash when scrolling to top --- static/src/js/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/src/js/app.js b/static/src/js/app.js index 7018c28..8837ffe 100644 --- a/static/src/js/app.js +++ b/static/src/js/app.js @@ -55,9 +55,9 @@ function scrollTo(offset) { ); } -$('#scroll-top').on('click', function(event) { - event.preventDefault(); +$('#scroll-top').on('click', function() { scrollTo(0); + window.history.pushState('', document.title, window.location.pathname); // Reset hash in URL }); $('a[href^="#"] ').on('click', function(event) {