From 0facd34738769388fe8f79c20ee05660f1639658 Mon Sep 17 00:00:00 2001 From: Alex Andreev Date: Wed, 9 Dec 2020 21:03:16 +0300 Subject: [PATCH] Fixing logs autoscroll behavior (#1720) * Fixing autoscroll behavior Signed-off-by: Alex Andreev * Making statement simpler to read Signed-off-by: Alex Andreev --- src/renderer/components/dock/pod-log-list.tsx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/renderer/components/dock/pod-log-list.tsx b/src/renderer/components/dock/pod-log-list.tsx index 392e0eefc0..a3ab172a16 100644 --- a/src/renderer/components/dock/pod-log-list.tsx +++ b/src/renderer/components/dock/pod-log-list.tsx @@ -95,15 +95,9 @@ export class PodLogList extends React.Component { @action setLastLineVisibility = (props: ListOnScrollProps) => { const { scrollHeight, clientHeight } = this.virtualListDiv.current; - const { scrollOffset, scrollDirection } = props; + const { scrollOffset } = props; - if (scrollDirection == "backward") { - this.isLastLineVisible = false; - } else { - if (clientHeight + scrollOffset === scrollHeight) { - this.isLastLineVisible = true; - } - } + this.isLastLineVisible = (clientHeight + scrollOffset) === scrollHeight; }; /**