CK编辑器5自定义构建on Change无法正常工作
我正在使用CK Editor 5在线构建工具来构建CK编辑器5的自定义构建。成功将其添加为React项目的依赖性。
包括提及插件和其他默认插件,
import Editor from "ckeditor5-custom-build/build/ckeditor";
<CKEditor
disabled={props.readOnly}
editor={Editor}
data={props.value ? props.value : ""}
config={{
readOnly: props.readOnly,
mention: {
feeds: [
{
marker: "@",
feed: getPersonByName,
minimumCharacters: 1,
},
],
},
toolbar: [],
}}
onChange={(_event: any, editor: { getData: () => any }) => {
const data = editor.getData();
handleChange(editor);
}}
onBlur={(_event: any, _editor: any) => {}}
onFocus={(_event: any, _editor: any) => {}}
/>
如预期的那样提及插件工作。但是编辑Onchange事件没有启动。因此,我无法获得编辑器值。
ckeditor.js:5
CKEditorError: editor-isreadonly-has-no-setter
I am using ck editor 5 online build tool to build a custom build of CK Editor 5. Successfully added it as a dependency of react project.
Included Mention plugin and other default plugins
import Editor from "ckeditor5-custom-build/build/ckeditor";
<CKEditor
disabled={props.readOnly}
editor={Editor}
data={props.value ? props.value : ""}
config={{
readOnly: props.readOnly,
mention: {
feeds: [
{
marker: "@",
feed: getPersonByName,
minimumCharacters: 1,
},
],
},
toolbar: [],
}}
onChange={(_event: any, editor: { getData: () => any }) => {
const data = editor.getData();
handleChange(editor);
}}
onBlur={(_event: any, _editor: any) => {}}
onFocus={(_event: any, _editor: any) => {}}
/>
mention plugin work as expected. but editors onChange event not firing.so I could not get the editor value.
ckeditor.js:5
CKEditorError: editor-isreadonly-has-no-setter
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将React版本更新为最新版本(18.0.0)将解决问题
Updating the React version to the latest version (18.0.0) would be fixed the issue