Problem/Motivation
When installing Real-time SEO module onto Drupal with CKEditor5 enabled. We can't see the changes realtime. We have to save the page and analyze the key words after the page is saved.
Steps to reproduce
- Install Drupal (9 or 10)
- Ensure CKEditor5 is enabled
- Ensure Yoast SEO is enabled
- Add new content
- Add a text to the CKEditor5 field
- Add keyword for analysis on Yoast SEO see that keyword are not recognized.
Proposed resolution
CKEditor by default updates the hidden textarea only on form submit.
What I've seen is that the js reads from the hidden textfield area. Real-Time SEO has a javascript file that updates the textarea but only works with CKEditor4. It checks and uses CKEDITOR object.
The proposed resolution is to use Drupal.CKEditor5Instances to do the same thing.
The problem is that CKEditor5 is attached after the page is loaded. And this is being discussed here: https://www.drupal.org/project/drupal/issues/3319358
Comments
Comment #2
igoragatti commentedI've created a patch as a solution.
But the patch from the related issue must be applied so that this patch can work.
Comment #3
sanjayk commentedI am also facing same issue and patch not getting apply through command.
I have implemented manually but didn't success. got stuck at line "ckeditor5.create".
worked for you?
Comment #4
szato commented@sanjayk,
they changed the event in core. You should use
$(document).on("editor:attached", function (event, el) {Comment #5
lbesenyei commentedI have updated the patch based on the event name change.