« 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
diff options
context:
space:
mode:
Diffstat (limited to 'ui/form')
-rw-r--r--ui/form/ListScrollForm.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/form/ListScrollForm.js b/ui/form/ListScrollForm.js
index 0e230b5..892f964 100644
--- a/ui/form/ListScrollForm.js
+++ b/ui/form/ListScrollForm.js
@@ -32,7 +32,7 @@ module.exports = class ListScrollForm extends Form {
     // we've scrolled, so we know right away that none of those will be
     // visible and we won't bother iterating over them. We do need to hide
     // them, though.
-    for (let i = 0; i < scrollItems; i++) {
+    for (let i = 0; i < Math.min(scrollItems, this.inputs.length); i++) {
       this.inputs[i].visible = false
     }