From 44cbdb269acc9ea58f10c81ed4bd1729bbfb4679 Mon Sep 17 00:00:00 2001 From: Mike Bender Date: Thu, 26 Dec 2024 13:53:29 -0500 Subject: [PATCH] fix: Console history scroll not always sticking to bottom (#2314) - Cherry-pick of: console scrolls on 1st code block run (#2275) - Cherry-pick of: Console does not scroll to bottom when code run from notebook (#2114) - Tested by running a large block of code --------- Co-authored-by: Matthew Runyon Co-authored-by: Steven Wu --- packages/console/src/Console.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/console/src/Console.tsx b/packages/console/src/Console.tsx index ae6ffec53a..69771acc2a 100644 --- a/packages/console/src/Console.tsx +++ b/packages/console/src/Console.tsx @@ -377,6 +377,7 @@ export class Console extends PureComponent { return; } + this.scrollConsoleHistoryToBottom(); this.updateHistory(result, newHistoryItem); this.updateKnownObjects(newHistoryItem); this.updateWorkspaceHistoryItem( @@ -649,7 +650,7 @@ export class Console extends PureComponent { } window.requestAnimationFrame(() => { - pane.scrollTop = pane.scrollHeight; + pane.scrollTo({ top: pane.scrollHeight }); }); }