« 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
diff options
context:
space:
mode:
-rw-r--r--ui/form/Form.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/form/Form.js b/ui/form/Form.js
index e5d756a..f1734ac 100644
--- a/ui/form/Form.js
+++ b/ui/form/Form.js
@@ -36,6 +36,13 @@ module.exports = class Form extends FocusElement {
     }
   }
 
+  selectInput(input) {
+    if (this.inputs.includes(input)) {
+      this.curIndex = this.inputs.indexOf(input)
+      this.updateSelectedElement()
+    }
+  }
+
   keyPressed(keyBuf) {
     // Don't do anything if captureTab is set to false. This is handy for
     // nested forms.