ckeditor / ckeditor5

Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.
https://ckeditor.com/ckeditor-5
Other
9.49k stars 3.7k forks source link

Unhandled Runtime Error TypeError: this.editor.disableReadOnlyMode is not a function #13153

Closed Arkamit closed 8 months ago

Arkamit commented 1 year ago

📝 Provide detailed reproduction steps (if any)

  1. Update to ckeditor5-react to 5.0.5
  2. Getting 'Error TypeError: this.editor.disableReadOnlyMode is not a function' whenever there is a change made in the editor.

✔️ Expected result

The editor should not throw any error on onChange event

❌ Actual result

Error TypeError: this.editor.disableReadOnlyMode is not a function

❓ Possible solution

Not sure what might be the reason

📃 Other details

CKEditor Code Block: <CKEditor id={id} disabled={disabled} editor={ Editor } config={ editorConfig } data={value ?? ""} //The editor instance of type Editor class in CKEditor. //eslint-disable-next-line @typescript-eslint/no-explicit-any onReady={ (editor: any) => { // You can store the "editor" and use when it is needed. console.log('Editor is ready to use!', editor); } } //The editor instance of type Editor class in CKEditor. //eslint-disable-next-line @typescript-eslint/no-explicit-any onChange={ (event: React.ChangeEvent, editor: any ) => { const data = editor.getData() //Sanitize the html before syncing to the form field value const sanitizedData = DOMPurify.sanitize(data); setValue(name, sanitizedData, { shouldDirty: true }) onControlChange?.((event.target as HTMLInputElement).value) UpdateDisplayState(name, caption, !basicUtils.IsStringNullOrWhitespace(sanitizedData) ? sanitizedData : EMPTY_VALUE) } } onBlur={ (event: React.ChangeEvent ) => { onControlBlur?.((event.target as HTMLInputElement).value) } } />


CKEditorBot commented 9 months ago

There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.

CKEditorBot commented 8 months ago

We've closed your issue due to inactivity over the last year. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it).