admin管理员组文章数量:1430807
I'm using Ckeditor5 with React and I got this warning in console when ponent is rendered, how can I get rid of this?
Error screenshot
This is the error reference on official doc
.html#error-widget-toolbar-no-items
And this is my ponent
export const EditorField = (props) => {
const {name,method,placeholder,isSimplified} = props
const link = {
decorators: {
toggleDownloadable: {
mode: 'manual',
label: 'Downloadable',
attributes: {
download: 'file'
}
},
openInNewTab: {
mode: 'manual',
label: 'Open in a new tab',
defaultValue: true,
attributes: {
target: '_blank',
rel: 'noopener noreferrer'
}
}
}
}
const image = {
toolbar: [
'imageTextAlternative',
'imageStyle:inline',
'imageStyle:block',
'imageStyle:side',
'linkImage'
]
}
const table = {
contentToolbar: [
'tableColumn',
'tableRow',
'mergeTableCells',
'tableCellProperties',
'tableProperties'
]
}
const toolbar = isSimplified ? {
items: [
'bold','italic','underline','strikethrough','|',
'link','|',
'specialCharacters','|',
'undo','redo'
], shouldNotGroupWhenFull: true
} : {
items: [
'heading','|',
'bold','italic','underline','strikethrough','|',
'fontColor','fontBackgroundColor','|',
'bulletedList','numberedList','|',
'link','imageUpload','insertTable','mediaEmbed','|',
'specialCharacters','blockQuote','horizontalLine','|',
'undo','redo'
], shouldNotGroupWhenFull: true
}
return (
<CKEditor
config={ {
toolbar,
language: 'it',
placeholder,
link,
image,
table,
} }
editor={ Editor }
data={request[name] || ''}
onChange={ (event, editor) => {
const data = editor.getData()
dispatch(setValue({method,name,value:data}))
} }
/>
)
}
I'm using Ckeditor5 with React and I got this warning in console when ponent is rendered, how can I get rid of this?
Error screenshot
This is the error reference on official doc
https://ckeditor./docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-widget-toolbar-no-items
And this is my ponent
export const EditorField = (props) => {
const {name,method,placeholder,isSimplified} = props
const link = {
decorators: {
toggleDownloadable: {
mode: 'manual',
label: 'Downloadable',
attributes: {
download: 'file'
}
},
openInNewTab: {
mode: 'manual',
label: 'Open in a new tab',
defaultValue: true,
attributes: {
target: '_blank',
rel: 'noopener noreferrer'
}
}
}
}
const image = {
toolbar: [
'imageTextAlternative',
'imageStyle:inline',
'imageStyle:block',
'imageStyle:side',
'linkImage'
]
}
const table = {
contentToolbar: [
'tableColumn',
'tableRow',
'mergeTableCells',
'tableCellProperties',
'tableProperties'
]
}
const toolbar = isSimplified ? {
items: [
'bold','italic','underline','strikethrough','|',
'link','|',
'specialCharacters','|',
'undo','redo'
], shouldNotGroupWhenFull: true
} : {
items: [
'heading','|',
'bold','italic','underline','strikethrough','|',
'fontColor','fontBackgroundColor','|',
'bulletedList','numberedList','|',
'link','imageUpload','insertTable','mediaEmbed','|',
'specialCharacters','blockQuote','horizontalLine','|',
'undo','redo'
], shouldNotGroupWhenFull: true
}
return (
<CKEditor
config={ {
toolbar,
language: 'it',
placeholder,
link,
image,
table,
} }
editor={ Editor }
data={request[name] || ''}
onChange={ (event, editor) => {
const data = editor.getData()
dispatch(setValue({method,name,value:data}))
} }
/>
)
}
Share
Improve this question
asked Oct 25, 2021 at 17:07
albertovalerioalbertovalerio
495 bronze badges
1 Answer
Reset to default 8I finally managed to fix this by adding this to my config.
removePlugins: ["MediaEmbedToolbar"],
At the moment, this plugin doesn't do anything: https://github./ckeditor/ckeditor5/issues/9824
本文标签: javascriptCkeditor5quotwidget toolbar no itemsquot toolbarId 39mediaEmbed39Stack Overflow
版权声明:本文标题:javascript - Ckeditor5 - "widget toolbar no items" {toolbarId: 'mediaEmbed'} - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745505637a2661230.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论