Submit a new display name on blur of input field

This commit is contained in:
Luke Barnard 2017-03-02 17:29:06 +00:00
parent f85c452e35
commit 7a092e4ac7
3 changed files with 13 additions and 3 deletions

View file

@ -116,6 +116,7 @@ export default class EditableTextContainer extends React.Component {
<EditableText initialValue={this.state.value}
placeholder={this.props.placeholder}
onValueChanged={this._onValueChanged}
blurToSubmit={this.props.blurToSubmit}
/>
);
}
@ -137,11 +138,15 @@ EditableTextContainer.propTypes = {
/* callback to update the value. Called with a single argument: the new
* value. */
onSubmit: React.PropTypes.func,
/* should the input submit when focus is lost? */
blurToSubmit: React.PropTypes.bool,
};
EditableTextContainer.defaultProps = {
initialValue: "",
placeholder: "",
blurToSubmit: false,
onSubmit: function(v) {return q(); },
};