File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
frontend/public/components/utils Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ export class LogWindow extends React.PureComponent {
21
21
content : '' ,
22
22
height : '' ,
23
23
} ;
24
+ this . prevScrollLeft = null ;
24
25
}
25
26
26
27
static getDerivedStateFromProps ( nextProps ) {
@@ -50,11 +51,19 @@ export class LogWindow extends React.PureComponent {
50
51
}
51
52
52
53
_handleScroll ( ) {
54
+ const scrollLeftChanged = this . prevScrollLeft !== this . scrollPane . scrollLeft ;
55
+
53
56
// Stream is finished, take no action on scroll
54
57
if ( this . props . status === STREAM_EOF ) {
55
58
return ;
56
59
}
57
60
61
+ // If horizontal scrolling, take no action
62
+ if ( scrollLeftChanged ) {
63
+ this . prevScrollLeft = this . scrollPane . scrollLeft ;
64
+ return ;
65
+ }
66
+
58
67
// 1px fudge for fractional heights
59
68
const scrollTarget = this . scrollPane . scrollHeight - ( this . scrollPane . clientHeight + 1 ) ;
60
69
if ( this . scrollPane . scrollTop < scrollTarget ) {
@@ -73,6 +82,7 @@ export class LogWindow extends React.PureComponent {
73
82
74
83
const targetHeight = Math . floor ( window . innerHeight - this . scrollPane . getBoundingClientRect ( ) . top -
75
84
( this . props . isFullscreen ? FULLSCREEN_FUDGE_FACTOR : FUDGE_FACTOR ) ) ;
85
+ this . prevScrollLeft = this . scrollPane . scrollLeft ;
76
86
this . setState ( {
77
87
height : targetHeight ,
78
88
} ) ;
You can’t perform that action at this time.
0 commit comments