diff options
author | Florrie <towerofnix@gmail.com> | 2019-09-15 18:28:55 -0300 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2019-09-15 18:28:55 -0300 |
commit | f3974627bddb9f62132bf54bde3a66c87dbf7b23 (patch) | |
tree | d6990f15885c0c660e91792987ef7d5a15ebb803 /ui | |
parent | d8943db70aab7e7192040caaf0bbf02d5ddf429c (diff) |
Add lastInput function to forms
Diffstat (limited to 'ui')
-rw-r--r-- | ui/form/Form.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ui/form/Form.js b/ui/form/Form.js index 74a1065..451baa4 100644 --- a/ui/form/Form.js +++ b/ui/form/Form.js @@ -117,6 +117,21 @@ module.exports = class Form extends FocusElement { } } + lastInput(selectForm = true) { + this.curIndex = this.inputs.length - 1 + + // TODO: See previousInput + if (!this.inputs[this.curIndex].selectable) { + this.previousInput() + } + + if (selectForm || ( + this.root.isChildOrSelfSelected && this.root.isChildOrSelfSelected(this) + )) { + this.updateSelectedElement() + } + } + selected() { if (this.root.selectedElement === this) { this.updateSelectedElement() |