我试图使用 ReactQuill 只是为了显示我拥有的一些富文本,因此我不希望它可以接收用户的任何输入或键入。原因,我有另一个库(ReactAce),ReactQuill 导致了一个错误,当我键入“删除”键时,它使 ReactAce 停止工作......
您可以在下面看到我正在尝试禁用 Quill 实例的示例。
quillRef = React.createRef();
componentDidMount = () => {
console.log(this.quillRef.current.editor);
this.quillRef.current.editor.enable(false); // undefined
};
render () {
<ReactQuill
readOnly
value={info}
ref={this.quillRef}
modules={quillConfig}
>
}
Run Code Online (Sandbox Code Playgroud)
如果您知道某种方法可以阻止 ReactQuill 接收来自键盘的任何输入,我会很高兴,因为我认为这是导致该错误的原因。
谢谢你!