« get me outta code hell

tui-lib - Pure Node.js library for making visual command-line programs (ala vim, ncdu)
about summary refs log tree commit diff
path: root/ui/form/Form.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/form/Form.js')
-rw-r--r--ui/form/Form.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/ui/form/Form.js b/ui/form/Form.js
index 87763bb..ac9f1e4 100644
--- a/ui/form/Form.js
+++ b/ui/form/Form.js
@@ -117,7 +117,9 @@ module.exports = class Form extends FocusElement {
     }
   }
 
-  focused() {
-    this.updateSelectedElement()
+  selected() {
+    if (this.root.selectedElement === this) {
+      this.updateSelectedElement()
+    }
   }
 }