Skip to content

Commit 941b569

Browse files
Merge pull request #1149 from dtaylor113/log-pause
Logs: Fixed 'horizontally scrolling resumes paused streaming'
2 parents 6165533 + a300be6 commit 941b569

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

frontend/public/components/utils/log-window.jsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export class LogWindow extends React.PureComponent {
2121
content: '',
2222
height: '',
2323
};
24+
this.prevScrollLeft = null;
2425
}
2526

2627
static getDerivedStateFromProps(nextProps) {
@@ -50,11 +51,19 @@ export class LogWindow extends React.PureComponent {
5051
}
5152

5253
_handleScroll() {
54+
const scrollLeftChanged = this.prevScrollLeft !== this.scrollPane.scrollLeft;
55+
5356
// Stream is finished, take no action on scroll
5457
if (this.props.status === STREAM_EOF) {
5558
return;
5659
}
5760

61+
// If horizontal scrolling, take no action
62+
if (scrollLeftChanged) {
63+
this.prevScrollLeft = this.scrollPane.scrollLeft;
64+
return;
65+
}
66+
5867
// 1px fudge for fractional heights
5968
const scrollTarget = this.scrollPane.scrollHeight - (this.scrollPane.clientHeight + 1);
6069
if (this.scrollPane.scrollTop < scrollTarget) {
@@ -73,6 +82,7 @@ export class LogWindow extends React.PureComponent {
7382

7483
const targetHeight = Math.floor(window.innerHeight - this.scrollPane.getBoundingClientRect().top -
7584
(this.props.isFullscreen ? FULLSCREEN_FUDGE_FACTOR : FUDGE_FACTOR));
85+
this.prevScrollLeft = this.scrollPane.scrollLeft;
7686
this.setState({
7787
height: targetHeight,
7888
});

0 commit comments

Comments
 (0)