« get me outta code hell

Add options to not call fixLayout automatically - 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
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2018-12-14 23:49:41 -0400
committerFlorrie <towerofnix@gmail.com>2018-12-14 23:49:41 -0400
commitd712d405f76178fc67b9421c113dccc3537e2a0c (patch)
treee43f2b49471fb6f0ef3bb9749d6d34207005dd50 /ui/form
parent99d2ed5b2f8bb39fa2517efd5a68dbb2b27b3121 (diff)
Add options to not call fixLayout automatically
Diffstat (limited to 'ui/form')
-rw-r--r--ui/form/Form.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/ui/form/Form.js b/ui/form/Form.js
index 6cdd5a5..7a82b31 100644
--- a/ui/form/Form.js
+++ b/ui/form/Form.js
@@ -11,19 +11,19 @@ module.exports = class Form extends FocusElement {
     this.captureTab = true
   }
 
-  addInput(input, asChild = true) {
+  addInput(input, asChild = true, opts = {}) {
     // Adds the given input as a child element and pushes it to the input
-    // list. If the second optional, asChild, is false, it won't add the
+    // list. If the optional argument asChild is false, it won't add the
     // input element as a child of the form.
 
     this.inputs.push(input)
 
     if (asChild) {
-      this.addChild(input)
+      this.addChild(input, opts)
     }
   }
 
-  removeInput(input, asChild = true) {
+  removeInput(input, asChild = true, opts = {}) {
     // Removes the given input from the form's input list. If the optional
     // argument asChild is false, it won't try to removeChild the input.
 
@@ -31,7 +31,7 @@ module.exports = class Form extends FocusElement {
       this.inputs.splice(this.inputs.indexOf(input), 1)
 
       if (asChild) {
-        this.removeChild(input)
+        this.removeChild(input, opts)
       }
     }
   }