From 6ee1936266dda3bd22e4412a7b51cdc6e3c396d5 Mon Sep 17 00:00:00 2001 From: Florrie Date: Fri, 19 Jan 2018 09:29:57 -0400 Subject: Pass false to firstInput to not select the form if it wasn't already selected --- ui/form/Form.js | 12 +++++++----- ui/form/ListScrollForm.js | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'ui/form') diff --git a/ui/form/Form.js b/ui/form/Form.js index 708de1f..ce064aa 100644 --- a/ui/form/Form.js +++ b/ui/form/Form.js @@ -80,15 +80,17 @@ module.exports = class Form extends FocusElement { this.updateSelectedElement() } - firstInput() { + firstInput(selectForm = true) { this.curIndex = 0 - this.updateSelectedElement() + if (selectForm || ( + this.root.isChildOrSelfSelected && this.root.isChildOrSelfSelected(this) + )) { + this.updateSelectedElement() + } } focused() { - if (this.root.select) { - this.root.select(this.inputs[this.curIndex]) - } + this.updateSelectedElement() } } diff --git a/ui/form/ListScrollForm.js b/ui/form/ListScrollForm.js index daa640a..a06efda 100644 --- a/ui/form/ListScrollForm.js +++ b/ui/form/ListScrollForm.js @@ -106,10 +106,10 @@ module.exports = class ListScrollForm extends Form { this.fixLayout() } - firstInput() { + firstInput(...args) { this.scrollItems = 0 - super.firstInput() + super.firstInput(...args) } getItemPos(item) { -- cgit 1.3.0-6-gf8a5