From 6b316062dcb8425145f3456f3b62abc1830776cd Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Thu, 7 Jul 2022 17:47:01 -0300 Subject: [PATCH] 18975: Fixes log viewer's follow mode when maximized. Added a 10% of scroll margin so that it's guaranteed that follow mode is enabled no matter the log viewer's height. The side effect is that the scrolling gets a "snap effect" when the user gets close to the end of the log. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- src/views/process-panel/process-log-code-snippet.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/process-panel/process-log-code-snippet.tsx b/src/views/process-panel/process-log-code-snippet.tsx index 261075c0dd..92e4ffba02 100644 --- a/src/views/process-panel/process-log-code-snippet.tsx +++ b/src/views/process-panel/process-log-code-snippet.tsx @@ -95,7 +95,7 @@ export const ProcessLogCodeSnippet = withStyles(styles)(connect()(
{ const elem = e.target as HTMLDivElement; - if (elem.scrollTop + elem.clientHeight >= elem.scrollHeight) { + if (elem.scrollTop + (elem.clientHeight*1.1) >= elem.scrollHeight) { setFollowMode(true); } else { setFollowMode(false); -- 2.30.2