« get me outta code hell

tui-lib - Pure Node.js library for making visual command-line programs (ala vim, ncdu)
about summary refs log tree commit diff
path: root/ui/form/ListScrollForm.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/form/ListScrollForm.js')
-rw-r--r--ui/form/ListScrollForm.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/ui/form/ListScrollForm.js b/ui/form/ListScrollForm.js
index a06efda..ae267c6 100644
--- a/ui/form/ListScrollForm.js
+++ b/ui/form/ListScrollForm.js
@@ -74,6 +74,10 @@ module.exports = class ListScrollForm extends Form {
       super.keyPressed(keyBuf)
     }
 
+    this.scrollSelectedElementIntoView()
+  }
+
+  scrollSelectedElementIntoView() {
     const sel = this.inputs[this.curIndex]
 
     // If the item is ahead of our view (either to the right of or below),