Skip to content
Snippets Groups Projects
Commit ff02c244 authored by Zoltan Runyo's avatar Zoltan Runyo
Browse files

Fix console output scroll handling

parent d44ed36e
No related branches found
No related tags found
No related merge requests found
Pipeline #97060 passed
......@@ -21,7 +21,7 @@ export function ConsoleOutput({html, dataReady, extraClass}) {
const [firstTime, setFirstTime] = useState(true);
const [autoScrollEnabled, setAutoScrollEnabled] = useState(true);
const [y, setY] = useState(window.scrollY);
const [y, setY] = useState(0);
useEffect(() => {
function scrollDown() {
......@@ -43,7 +43,10 @@ export function ConsoleOutput({html, dataReady, extraClass}) {
if (y > pane.scrollTop) {
// Scroll up event
setAutoScrollEnabled(false);
}
} else if ( pane.scrollHeight - pane.scrollTop === pane.clientHeight) {
// Scroll to bottom
setAutoScrollEnabled(true);
}
setY(pane.scrollTop);
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment