« get me outta code hell

Add scrollSelectedElementIntoView function - 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
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2018-06-01 08:35:44 -0300
committerFlorrie <towerofnix@gmail.com>2018-06-01 08:35:44 -0300
commit23dc4b24d92eb2e19c55029522acabfccb701915 (patch)
tree56714f19c06b38f7d1baf0486fe09d3a1d9b21d6 /ui
parentb7e7223670328b4cba1c1454dd25057d24025b2b (diff)
Add scrollSelectedElementIntoView function
Diffstat (limited to 'ui')
-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),