From e81c044a17c933f81471c28d493608aa879f9724 Mon Sep 17 00:00:00 2001 From: Shreya Date: Sun, 8 Mar 2020 19:45:18 +0530 Subject: [PATCH] Autoscroll to last line in telemetry console TODO: Don't scroll to last line if user has scrolled up --- monkey/monkey_island/cc/ui/src/components/pages/MapPage.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/monkey/monkey_island/cc/ui/src/components/pages/MapPage.js b/monkey/monkey_island/cc/ui/src/components/pages/MapPage.js index 278b4c791..095d5e7f0 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/MapPage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/MapPage.js @@ -66,6 +66,8 @@ class MapPageComponent extends AuthComponent { telemetry: newTelem, telemetryLastTimestamp: res['timestamp'] }); + var telemConsole = document.querySelector('div.telemetry-console'); + telemConsole.scrollTop = telemConsole.scrollHeight - telemConsole.clientHeight this.props.onStatusChange(); } });