diff options
Diffstat (limited to 'app/client/common/textInput.component.js')
| -rw-r--r-- | app/client/common/textInput.component.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/client/common/textInput.component.js b/app/client/common/textInput.component.js index a3739d4..44e1349 100644 --- a/app/client/common/textInput.component.js +++ b/app/client/common/textInput.component.js @@ -12,7 +12,7 @@ class TextInput extends Component { value: e.target.value, changed: true, }) - this.props.onInput && this.props.onInput(e.target.value) + this.props.onInput && this.props.onInput(e.target.value, e.target.name) } handleKeydown(e){ if (e.keyCode === 13) { @@ -20,7 +20,7 @@ class TextInput extends Component { value: e.target.value, changed: false, }) - this.props.onSave && this.props.onSave(e.target.value) + this.props.onSave && this.props.onSave(e.target.value, e.target.name) } } render() { @@ -29,7 +29,8 @@ class TextInput extends Component { <label> <span>{this.props.title}</span> <input - type='text' + type={this.props.type || 'text'} + name={this.props.name || 'text'} value={this.state.changed ? this.state.value : this.props.value} onInput={this.handleInput} onKeydown={this.handleKeydown} |
