Browse Source

Implement manual scroll and focus on termDiv element in the DOMConsole class

Lucas de Souza 5 years ago
parent
commit
dda8f7ac6d
1 changed files with 3 additions and 4 deletions
  1. 3 4
      js/io/domConsole.js

+ 3 - 4
js/io/domConsole.js

@@ -206,7 +206,7 @@ export class DOMConsole {
 
   scrollTerm () {
     //scrollIt(this.inputDiv.previousSibling,200);
-    this.inputDiv.previousSibling.scrollIntoView();
+    this.termDiv.scrollTop = this.termDiv.scrollHeight;
   }
 
   focus () {
@@ -216,9 +216,8 @@ export class DOMConsole {
     if(this.parent.style.top.length == 0) {
       this.parent.style.marginTop = "-160px";
     }
-    const prev = this.inputDiv.closest('div');
-    if(prev != null)
-      prev.scrollIntoView();
+    this.termDiv.scrollIntoView();
+    this.scrollTerm();
   }
 
   hide () {