diff options
Diffstat (limited to 'ui')
-rw-r--r-- | ui/form/Form.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ui/form/Form.js b/ui/form/Form.js index f1734ac..87763bb 100644 --- a/ui/form/Form.js +++ b/ui/form/Form.js @@ -71,7 +71,11 @@ module.exports = class Form extends FocusElement { } updateSelectedElement() { - if (this.root.select) { + if (this.root.select && this.inputs.length) { + if (this.curIndex > this.inputs.length - 1) { + this.curIndex = this.inputs.length - 1 + } + this.root.select(this.inputs[this.curIndex]) } } |