Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CKEditor4-react gives editor-element-conflict #57

Closed
rasika-sinha opened this issue Aug 8, 2019 · 12 comments · Fixed by #83
Closed

CKEditor4-react gives editor-element-conflict #57

rasika-sinha opened this issue Aug 8, 2019 · 12 comments · Fixed by #83
Assignees
Labels
status:confirmed An issue confirmed by the development team. type:bug A bug.
Milestone

Comments

@rasika-sinha
Copy link

I am trying to POC CKEditor for my React app, the features are working fine but I am getting an error consistently -

[CKEDITOR] Error code: editor-element-conflict. {editorName: "editor1"}

Even if I simply copy paste the code from "DataBinding" example shared https://ckeditor.com/docs/ckeditor4/latest/guide/dev_react.html, then also it throws an error in console. Please see attached image for reference.

Reproduction steps

1 installed ckeditor4-react
2. created TwoWayBinding.js with code from https://ckeditor.com/docs/ckeditor4/latest/guide/dev_react.html#data-binding
3. called the TwoWayBinding component in render of another empty component

Expected result

CKEditor with standard features should get rendered

Actual result

CKEditor with standard features is rendered but there are 2 errors in console pointing to https://ckeditor.com/docs/ckeditor4/latest/guide/dev_errors.html#editor-element-conflict

The render of TwoWayBinding.js is called only once. None of the existing threads on stackoverflow or git talk about "editor-element-conflict" issue with respect to react.

There is one one wrapper library present - https://www.npmjs.com/package/react-ckeditor-component, if this is used then the error does not come, but ideally I want to use the official library of CKEditor.

Kindly share the preferred solution.

Other details

  • Browser: chrome
  • OS: windows 10
  • Integration version: React16
  • CKEditor version: CKEditor4
  • Installed CKEditor plugins: none

Error in DataBinding Example

@NSV1991
Copy link

NSV1991 commented Aug 10, 2019

also facing same issue

@rasika-sinha
Copy link
Author

Hi @f1ames , I noticed that you responded to recent issues posted for ckeditor hence tagging you, can you please take a look at the above issue if possible.

Thanks!

@Comandeer
Copy link
Member

It seems to be a bug in integration itself, as it's present also in our docs. Fortunately there is an easy workaround: use of CKEDITOR.disableAutoInline.

<CKEditor onBeforeLoad={ ( CKEDITOR ) => ( CKEDITOR.disableAutoInline = true ) } />

@Comandeer Comandeer added the bug label Aug 12, 2019
@rasika-sinha
Copy link
Author

Thank you @Comandeer, the work around does the job!

I have one more blocker issue with ckeditor, it is regarding easy image upload plugin. I want the images to be saved at a folder hosted by us and not use the cloud service of ckeditor. I have shared the details at https://stackoverflow.com/questions/57431210/ckeditor4-react-add-easyimage-plugin-without-cloud-url as well.

@f1ames f1ames added this to the Backlog milestone Sep 27, 2019
@GTRekter
Copy link

It seems to be a bug in integration itself, as it's present also in our docs. Fortunately there is an easy workaround: use of CKEDITOR.disableAutoInline.

<CKEditor onBeforeLoad={ ( CKEDITOR ) => ( CKEDITOR.disableAutoInline = true ) } />

It works for me

@f1ames f1ames modified the milestones: Backlog, Next Nov 14, 2019
@jayc971
Copy link

jayc971 commented Dec 17, 2019

It seems to be a bug in integration itself, as it's present also in our docs. Fortunately there is an easy workaround: use of CKEDITOR.disableAutoInline.

<CKEditor onBeforeLoad={ ( CKEDITOR ) => ( CKEDITOR.disableAutoInline = true ) } />

It works for me

how to put it in?

@bodfaj13
Copy link

bodfaj13 commented Jan 1, 2020

worked alright, thanks 😎

@gkumar9

This comment has been minimized.

@f1ames
Copy link
Contributor

f1ames commented Feb 7, 2020

@gkumar9 could you report a separate issue as it is not related to this thread?

@jacekbogdanski jacekbogdanski added type:bug A bug. status:confirmed An issue confirmed by the development team. and removed bug labels Feb 7, 2020
@Comandeer Comandeer self-assigned this Feb 18, 2020
@kiminohero
Copy link

kiminohero commented Feb 21, 2020

Still getting the same error even after using the onBeforeLoad prop.
I am using the following code

import CKEditor from "ckeditor4-react";

class CKEditorFull extends CKEditor {
  constructor(props) {
    super(props);
    CKEditor.editorUrl = "https://cdn.ckeditor.com/4.13.0/full-all/ckeditor.js";
  }
}

export default CKEditorFull;

<CKEditorFull
             onBeforeLoad={(CKEDITOR) => (CKEDITOR.disableAutoInline = true)}
                data={this.state.someData}
                config={Config}
                onChange={this.inputChangeFooter}
              />

I am rendering 2 instances of the above component in the same page.
Can please help me out?

@watercayman
Copy link

Getting this same issue without React. The workaround from @Comandeer is not successful for me.

Never had it before, but turned on pasteFromWord and downloaded latest version of ckeditor.js, and now it shows up on all pages where I use the pasteFromWord plugin. It does not present the error on pages where I don't use the plugin. I haven't changed any code except to allow pasteFromWord.

@f1ames f1ames closed this as completed in #83 Mar 3, 2020
@kiminohero
Copy link

I am still facing the above issue. I think the onBeforeLoad prop is not working for me. It is not executing at all. I am still using the same code as my previous comment here but I have updated the editorUrl to version 4.14.1. I am also using the latest ckeditor4-react i.e v1.1.1. Can you please look into it? Thanks.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:confirmed An issue confirmed by the development team. type:bug A bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.