[英]React-medium-Editor Text Not working
I am using react-medium-editor ( https://github.com/wangzuo/react-medium-editor ) and text in Editor never goes blank 我正在使用react-medium-editor( https://github.com/wangzuo/react-medium-editor )并且编辑器中的文本永远不会空白
handleChange=(text)=>{
this.setState({text: text});
}
Submit(){
this.setState({text: ''});
}
render(){
return(
<div>
<Editor
text={this.state.text}
onChange={this.handleChange}
options={{placeholder: {text: "Write your response here"},
toolbar: {buttons: ['bold', 'italic', 'underline'],
}}} />
<button onClick={this.Submit.bind(this)}></button>
</div>
)
}
when i click on button this.setState is setting up value of Text to blank but Editor text never goes to blank. 当我单击按钮this.setState将文本的值设置为空白,但编辑器文本永远不会为空。
How i can make Editor value blank by setting up state. 我如何通过设置状态使编辑器值空白。
Make the last commit or show the Editor here. 进行最后一次提交或在此处显示编辑器。 I can't test it.
我无法测试。 (Or specify in which branch this happens)
(或指定发生在哪个分支)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.