From 8e4536fd98bf67223210d125e4a1798fd8dc7d96 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 (cherry picked from commit ec4a0e1b6e9c955088750f92819ec2824291d2d2) --- 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 c4bd70b71d..9938d5371f 100644 --- a/web_src/js/features/repo-issue.js +++ b/web_src/js/features/repo-issue.js @@ -478,6 +478,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) {