Created
June 16, 2017 13:30
-
-
Save romreed/212c3808739cf1cbff22cafc202cbb50 to your computer and use it in GitHub Desktop.
enter event react
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add(event) { | |
if (event.key === 'Enter') { | |
this.props.search(this.state.value) | |
} | |
} | |
<TextField style={this.state.close === true ? styles.showInput : styles.hideInput} | |
id="text-field-controlled" | |
value={this.state.value} | |
inputStyle={styles.colorInput} | |
onChange={this.handleChange} | |
ref={(input) => this.focusInput = input} | |
onKeyPress={this.add.bind(this)} | |
/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment