diff options
author | Florrie <towerofnix@gmail.com> | 2018-06-04 23:40:50 -0300 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2018-06-04 23:40:50 -0300 |
commit | 62348f48fbe2da7ab2af0e3ea71b0fbe7380b31e (patch) | |
tree | 3ac69e6034dcfe0263814e99b818992dba2f5424 | |
parent | c42add3c9edb6446a759ae4f5a2b3e81cf56f4f5 (diff) |
Form.selectInput function
-rw-r--r-- | ui/form/Form.js | 7 |
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. |