From: Lucas Di Pentima Date: Thu, 7 Jul 2022 20:47:01 +0000 (-0300) Subject: 18975: Fixes log viewer's follow mode when maximized. X-Git-Tag: 2.5.0~47^2~1 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/6b316062dcb8425145f3456f3b62abc1830776cd 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 --- diff --git a/src/views/process-panel/process-log-code-snippet.tsx b/src/views/process-panel/process-log-code-snippet.tsx index 261075c0..92e4ffba 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);