File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -986,6 +986,22 @@ class Dashboard {
986986 byId ( "read-the-help" ) . style . display = "block" ;
987987 }
988988
989+ // We automatically scroll log windows to the bottom as lines are added,
990+ // and for performance reasons we have `content-visibility: auto` to skip
991+ // rendering when they are outside the viewport (at least in Chrome where
992+ // this CSS property is supported).
993+ //
994+ // However, when they are outside the viewport, they fail to get scrolled
995+ // to the bottom by `scrollToBottom` because they aren't rendering anything.
996+ // Listen to contentvisibilityautostatechange and scroll these log windows
997+ // to the bottom after they go back into the viewport and their rendering
998+ // is no longer being skipped.
999+ document . body . addEventListener ( "contentvisibilityautostatechange" , ( ev ) => {
1000+ if ( ! ev . skipped && ev . target . classList . contains ( "log-window" ) ) {
1001+ scrollToBottom ( ev . target ) ;
1002+ }
1003+ } ) ;
1004+
9891005 this . messageCount = 0 ;
9901006 this . newItemsReceived = 0 ;
9911007 this . newBytesReceived = 0 ;
You can’t perform that action at this time.
0 commit comments