From e0c9898479be598bd5673ffc28a15ad227897b86 Mon Sep 17 00:00:00 2001 From: HesterG Date: Thu, 16 Mar 2023 12:32:23 +0800 Subject: [PATCH] fix lint --- web_src/js/features/repo-issue.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js index d1fee55749bd..f492df636222 100644 --- a/web_src/js/features/repo-issue.js +++ b/web_src/js/features/repo-issue.js @@ -438,6 +438,10 @@ export async function handleReply($el) { export function initRepoPullRequestReview() { if (window.location.hash && window.location.hash.startsWith('#issuecomment-')) { + // set scrollRestoration to 'manual' when there is a hash in url, so that the scroll position will not be remembered after refreshing + if (window.history.scrollRestoration !== 'manual') { + window.history.scrollRestoration = 'manual'; + } const commentDiv = $(window.location.hash); if (commentDiv) { // get the name of the parent id