From a9d887a5e8bab1e44f06d67d776ea5ba058d7ef7 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 12 Dec 2025 12:16:48 -0800 Subject: [PATCH] improvements --- web_src/js/features/repo-diff.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/web_src/js/features/repo-diff.ts b/web_src/js/features/repo-diff.ts index 7aa0c7ca71..206b5964a7 100644 --- a/web_src/js/features/repo-diff.ts +++ b/web_src/js/features/repo-diff.ts @@ -256,11 +256,9 @@ async function onLocationHashChange() { // eslint-disable-next-line unicorn/prefer-query-selector const commentElement = document.getElementById(hashValue); if (commentElement) { - commentElement.scrollIntoView(); - document.body.setAttribute(diffAutoScrollAttr, 'true'); + commentElement.scrollIntoView({behavior: 'instant'}); window.location.hash = ''; window.location.hash = currentHash; - setTimeout(() => document.body.removeAttribute(diffAutoScrollAttr), 0); return; } }