Closed Arkamit closed 8 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.
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).
📝 Provide detailed reproduction steps (if any)
✔️ 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) } } />