最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How can I add a Placeholder in a React CKEDITOR - Stack Overflow

programmeradmin1浏览0评论

I have read the documentation of ckeditor regarding the React Context , but I couldn't find how to make a Placeholder on the CKEditor.

This is the link to the react ckeditor react ckeditor

This is the sample code :

<CKEditor
    onInit={editor => {
        // Insert the toolbar before the editable area.
        editor.ui.view.editable.element.parentElement.insertBefore(
        editor.ui.view.toolbar.element,
        editor.ui.view.editable.element);}}
        name={this.state.body}
        onChange={this.handleEditorChange}
        editor={DecoupledEditor}
        data={this.state.body}
        />

I have read the documentation of ckeditor regarding the React Context , but I couldn't find how to make a Placeholder on the CKEditor.

This is the link to the react ckeditor react ckeditor

This is the sample code :

<CKEditor
    onInit={editor => {
        // Insert the toolbar before the editable area.
        editor.ui.view.editable.element.parentElement.insertBefore(
        editor.ui.view.toolbar.element,
        editor.ui.view.editable.element);}}
        name={this.state.body}
        onChange={this.handleEditorChange}
        editor={DecoupledEditor}
        data={this.state.body}
        />
Share Improve this question asked Oct 23, 2018 at 11:57 Lutaaya Huzaifah IdrisLutaaya Huzaifah Idris 3,9909 gold badges43 silver badges86 bronze badges 1
  • 1 See github.com/ckeditor/ckeditor5/issues/479 – Gabriele Petrioli Commented Oct 23, 2018 at 12:23
Add a comment  | 

1 Answer 1

Reset to default 20
<CKEditor 
  config={{placeholder: "Placeholder text..."}} 
  ... 
  />

Works for me

发布评论

评论列表(0)

  1. 暂无评论