diff options
author | Florrie <towerofnix@gmail.com> | 2018-06-12 23:40:47 -0300 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2018-06-12 23:40:47 -0300 |
commit | 5ca7837f83be3c3ea1081db150ece49875fa61a0 (patch) | |
tree | e339d94d9133a8a6f1d4a15f3a258af94d85cd55 /ui/form | |
parent | 774e1e094f0873be539242c5c80a4130200cb700 (diff) |
Be a little careful in Form.updateSelectedElement
Diffstat (limited to 'ui/form')
-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]) } } |