未验证 提交 d01d3951 编写于 作者: J Jan Faracik 提交者: GitHub

[JENKINS-69587] Fix console view bouncing when new entries appear (#7348)

上级 e6f7243c
......@@ -37,10 +37,13 @@ window.addEventListener("load", function () {
const headerToScrollTo = document.getElementById(
item.querySelector(".task-link").dataset.sectionId
);
document.documentElement.scrollTop =
i === 0
? 0
: headerToScrollTo.getBoundingClientRect().top + window.scrollY - 70;
const sectionTopPosition =
headerToScrollTo.getBoundingClientRect().top + window.scrollY - 70;
window.scrollTo({
top: i === 0 ? 0 : sectionTopPosition,
behavior: "smooth",
});
});
sidebarItems.insertAdjacentElement("beforeend", item);
......
......@@ -58,5 +58,4 @@ html {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-tap-highlight-color: transparent;
scroll-behavior: smooth;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册