Skip to content

Commit 9a57f35

Browse files
rodrigo-sobraletejedor
authored andcommitted
swancustomenvironments: Fix the auto scrolling to output-box feature
1 parent fd3044e commit 9a57f35

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

SwanCustomEnvironments/swancustomenvironments/templates/customenvs.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@
7474
const file = `/${urlParams.get('file') || ""}`;
7575

7676
// Scroll to the output-box height
77-
window.scrollTo(0, outputBox.scrollHeight);
77+
outputBox.scrollIntoView({
78+
behavior: "smooth",
79+
block: "start" // aligns the top of the element with the top of the scroll area
80+
});
7881

7982
const get_jh_auth_header = () => {
8083
const xsrf = document.cookie.match(/\b_xsrf=([^;]*)\b/);

0 commit comments

Comments
 (0)