26
Views
1
Comments
Solved
[CKEditor 5 Reactive] CKEditor5 Reactive: how do I set or add data after initializing?
ckeditor-5-reactive
Reactive icon
Forge asset by Mukesh Singh
Application Type
Reactive

Hi there!


I'm trying to use the CKEditor5 Reactive Forge Component and got it to load initial content into the editor (for example for editing a document).

Now my next challenge is that on the OnParametersChanged action, the forge component simply loads the editor again, creating a new instance of this editor on the screen.

I would like to be able to first destroy the editor in the OnParametersChanged, but I haven't gotten that to work.
Here's what I tried to call the destroy() function, this does not work.


I also tried to use OnParametersChanged to call the setData() function in CKEditor. This also didn't work:

I'm not proficient in JavaScript, so I'm piecing this together from what I find in the documentation and in answers online, so I'm probably missing something small here.

thanks in advance for your help!
Marleen

UserImage.jpg
Marleen Renders
Solution

I was able to fix this. Apparently I used the wrong CSS selector.

After I changed the selector to the following, it worked!
"#" + $parameters.TextAreaId + " + div div .ck-editor__editable_inline"

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.