您的位置:首页 > Web前端 > React

react native 安卓TextInput点击键盘上的search按钮触发两次的解决办法

2016-10-25 17:15 471 查看
<TextInput
ref={component => this._textInput = component}
onSubmitEditing={this._onSubmitEditing.bind(this)}
onEndEditing={this._onPressSearch.bind(this)}
returnKeyType='search'
style={styles.inputText}/>

_onSubmitEditing(){
this._textInput.blur();
}
_onPressSearch(event){
console.log(event.nativeEvent.text);
}
参考链接http://stackoverflow.com/questions/38710253/onsubmitediting-is-called-twice-when-keyboard-is-dismissed
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐