mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fixing logs autoscroll behavior (#1720)
* Fixing autoscroll behavior Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Making statement simpler to read Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
fc20b22bb5
commit
0facd34738
@ -95,15 +95,9 @@ export class PodLogList extends React.Component<Props> {
|
|||||||
@action
|
@action
|
||||||
setLastLineVisibility = (props: ListOnScrollProps) => {
|
setLastLineVisibility = (props: ListOnScrollProps) => {
|
||||||
const { scrollHeight, clientHeight } = this.virtualListDiv.current;
|
const { scrollHeight, clientHeight } = this.virtualListDiv.current;
|
||||||
const { scrollOffset, scrollDirection } = props;
|
const { scrollOffset } = props;
|
||||||
|
|
||||||
if (scrollDirection == "backward") {
|
this.isLastLineVisible = (clientHeight + scrollOffset) === scrollHeight;
|
||||||
this.isLastLineVisible = false;
|
|
||||||
} else {
|
|
||||||
if (clientHeight + scrollOffset === scrollHeight) {
|
|
||||||
this.isLastLineVisible = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user