diff --git a/web_src/js/features/repo-issue-pull.ts b/web_src/js/features/repo-issue-pull.ts index 3fcaa604467..77948c4edda 100644 --- a/web_src/js/features/repo-issue-pull.ts +++ b/web_src/js/features/repo-issue-pull.ts @@ -53,7 +53,9 @@ function initRepoPullMergeBoxRefresh(el: Element) { const resp = await GET(`${pullLink}/merge_box`); if (!resp.ok) return; const newEl = createElementFromHTML(await resp.text()); + const scrollTop = el.querySelector('.commit-status-list')?.scrollTop; el.replaceWith(newEl); // don't morph, do full replacement to make sure data-global-init and Vue components are re-initialized + if (scrollTop) newEl.querySelector('.commit-status-list')?.scrollTo({top: scrollTop, behavior: 'instant'}); }, }); }