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

editor.setData() doesn't visually show the updated data in Source mode editor #15957

Open
sudheerb opened this issue Mar 1, 2024 · 3 comments
Labels
domain:v4-compatibility This issue reports a CKEditor 4 feature/option that's missing in CKEditor 5. package:source-editing type:improvement This issue reports a possible enhancement of an existing feature.

Comments

@sudheerb
Copy link

sudheerb commented Mar 1, 2024

📝 Provide detailed reproduction steps (if any)

  1. Switch to Source Mode in CKE5
  2. Invoke setData() like editor.setData('<p>Data in Source mode</p>')
  3. Observe that source mode visually doesn't reflect the updated data. However, editor.getData() gives the updated data.
    This is resulting into inconsistency. Data seen on editor is different that what is actually present.
  4. Note that this issue doesn't exist in Design (WYSIWYG) mode. setData() does reflect the updated data on editor immediately.

✔️ Expected result

setData() should reflect the updated data visually also in the source mode immediately and should be consistent with data fetched by getData().

❌ Actual result

editor.getData() has the updated data but source mode visually doesn't show the updated data.

❓ Possible solution

Workaround:
Do setData() in sourceMode, toggle to design mode and come back to source mode to visually see the updated data.

📃 Other details

  • I don't think this is environment specific data. Issue reproducible on editor running on CKE5 demo pages as well.
  • Also, this scenario used to work fine in CKEditor 4.
  • Browser: Chrome
  • OS: Mac
  • First affected CKEditor version: …
  • Installed CKEditor plugins: sourceEditing

If you'd like to see this fixed sooner, add a 👍 reaction to this post.

@sudheerb sudheerb added the type:bug This issue reports a buggy (incorrect) behavior. label Mar 1, 2024
@Witoso
Copy link
Member

Witoso commented Mar 4, 2024

Hi! Thanks for report, changing to an improvement ticket, currently Source Editing doesn't listen to changes that are happening on the document.

@Witoso Witoso added type:improvement This issue reports a possible enhancement of an existing feature. domain:v4-compatibility This issue reports a CKEditor 4 feature/option that's missing in CKEditor 5. package:source-editing and removed type:bug This issue reports a buggy (incorrect) behavior. labels Mar 4, 2024
@C-Nedelcu
Copy link

hello,

we're having this issue right now and we need a workaround

@sudheerb how do you implement the workaround/possible solution that you mentioned in your post?

@sudheerb
Copy link
Author

sudheerb commented Nov 14, 2024

Hi @C-Nedelcu ,
See this comment for the workaround we are using.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:v4-compatibility This issue reports a CKEditor 4 feature/option that's missing in CKEditor 5. package:source-editing type:improvement This issue reports a possible enhancement of an existing feature.
Projects
None yet
Development

No branches or pull requests

3 participants