From a9563b80dfdb46692fb60cb65b791f53c53cb2af Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Wed, 1 Mar 2017 15:31:05 -0500 Subject: [PATCH 1/4] Add a "text-number" form field type, and add styles for 2 others --- js/component/form.js | 11 +++++++---- scss/_gui.scss | 8 ++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/js/component/form.js b/js/component/form.js index 1d2b63bf6..33e4aee66 100644 --- a/js/component/form.js +++ b/js/component/form.js @@ -22,9 +22,12 @@ var FormField = React.createClass({ } }, componentWillMount: function() { - if (['text', 'radio', 'checkbox', 'file'].indexOf(this.props.type) != -1) { + if (['text', 'radio', 'checkbox', 'file'].includes(this.props.type)) { this._element = 'input'; this._type = this.props.type; + } else if (this.props.type == 'text-number') { + this._element = 'input'; + this._type = 'text'; } else { // Non field, e.g.