From ec4a0e1b6e9c955088750f92819ec2824291d2d2 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Thu, 24 Oct 2024 15:13:58 +0200 Subject: [PATCH] fix: reset `history.scrollRestoration` if set to `manual` and no issue anchor in url --- web_src/js/features/repo-issue.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js index 0b0c1ff9bc..cea817ba01 100644 --- a/web_src/js/features/repo-issue.js +++ b/web_src/js/features/repo-issue.js @@ -481,6 +481,9 @@ export function initRepoPullRequestReview() { }); } } + } else if (window.history.scrollRestoration === 'manual') { + // reset scrollRestoration to 'auto' if there is no hash in url and we set it to 'manual' before + window.history.scrollRestoration = 'auto'; } $(document).on('click', '.show-outdated', function (e) {