From 34293553a85e7970638c48e3e07eb936c481d34b Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 2 Aug 2022 21:11:57 +0100 Subject: [PATCH] Don't browse to hash if there isn't one --- static/src/js/base.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/static/src/js/base.js b/static/src/js/base.js index 94a7cb5..acc333d 100644 --- a/static/src/js/base.js +++ b/static/src/js/base.js @@ -61,6 +61,10 @@ window.addEventListener("load", () => { window.addEventListener("DOMContentLoaded", () => { setHeroHeight(); + if (window.location.hash <= 1) { + return; + } + let scrollTarget = null; try { scrollTarget = document.getElementById(window.location.hash.slice(1));