<TextInput style={[styles.textInput]}
placeholder='搜索'
placeholderTextColor='#bbb'
onChange={(event) => {
this.searchChange(event.nativeEvent.text)
}}
returnKeyType='search'
autoFocus={true}
value={ this.props.searchName }
selectionColor={colors.orangeColor}
onSubmitEditing={this.searchSubmit}
clearButtonMode="while-editing"
/>
var Input = React.createClass({
render: function () {
return <input type="text" onKeyDown={this._handleKeyDown} />;
},
_handleKeyDown: function(e) {
if (e.key === 'Enter') {
console.log('do validate');
}
}
});
onSubmitEditing={"enter key pressed"}
var Input = React.createClass({
render: function () {
return <input type="text" onKeyDown={this._handleKeyDown} />;
},
_handleKeyDown: function(e) {
if (e.key === 'Enter') {
console.log('do validate');
}
}
});
//inline
onSubmitEditing={"enter key pressed"}