当用户提交或按下键盘的enter/next键时,我需要隐藏键盘。这是我在RichEditor TextInput中使用的代码。
<RichEditor
ref={rf => this.richText = rf}
initialContentHTML={this.state.PostDescription}
style={{
// minHeight:Platform.OS === 'ios' ? 30 : 40,
// maxHeight:Platform.OS === 'ios' ? 100: 40,
height:'100%',
backgroundColor:'white',
flex: 1,justifyContent:'center',
minWidth:'100%',width:'100%'
}}
/>发布于 2020-04-02 21:09:10
以this代码为例,您可以使用以下命令使RichEditor模糊:
this.richText.blurContentEditor();但是,没有OnSubmit函数(至少我在搜索时没有找到它),因为它只是一个react-native-webview的webview,而不是一个TextInput。
您可以使用react-native-webview-quilljs,因为它们有ON_KEY_PRESS事件并按Enter键。
https://stackoverflow.com/questions/60970508
复制相似问题