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

CKEditor data not updated correctly if v-model changes during initialization timing window #139

Open
wsiota opened this issue Apr 29, 2022 · 2 comments
Labels
status:confirmed An issue confirmed by the development team. type:bug A bug.

Comments

@wsiota
Copy link

wsiota commented Apr 29, 2022

Are you reporting a feature request or a bug?

Bug

Provide detailed reproduction steps (if any)

https://codesandbox.io/s/ckeditor4-vue-bug-report-v-model-timing-window-issue-s83ys2

  1. Use v-model with CKEditor4-Vue.
  2. Initialize this v-model to some value (the "initial value").
  3. Set the editor v-model to another value (the "new value") immediately after the instanceReady CKEditor event is emitted (or close to this timing window).

Expected result

CKEditor should show the updated model value ("new value").

Actual result

CKEditor shows the original model value ("initial value").

Other details

  • Browser: Tested on Chrome and Firefox
  • OS: Tested on MacOS
  • Integration version: 2.0.0, but also versions before this
  • CKEditor version: 4.18.0, but also versions before this
  • Installed CKEditor plugins: …

Additional Notes

  1. If the v-model "initial value" is set to an empty string and the "new value" is set during this timing window:
    • CKEditor will be empty
    • However, the v-model will contain the "new value." This means that Vue is still aware of what the editor value should be.
  2. If the v-model "initial value" is not an empty string and the "new value" is set during this timing window:
    • CKEditor will show the "initial value"
    • The v-model will not contain the "new value", as it is somehow overwritten (perhaps by an errant input event?). This means that the "new value" is lost!

We hit this by populating the CKEditor contents upon a page load from an async call (using v-model). It is not consistently reproducible in our app as it depends on hitting what seems to be a narrow timing window. But the provided CodeSandbox appears to consistently reproduce this by changing the v-model on the instanceReady event.

This could be related to #50.

@github-actions
Copy link

github-actions bot commented May 7, 2022

It's been a while since we last heard from you. We are marking this issue as stale due to inactivity. Please provide the requested feedback or the issue will be closed after next 7 days.

@github-actions github-actions bot added the stale The issue / PR will be closed within the next 7 days of inactivity. label May 7, 2022
@KarolDawidziuk
Copy link
Contributor

Hello, @wsiota, thanks for the report and I'm sorry for the late reply.

I see, that even giving a zero-latency timeout in the instanceReady() method for a model update solves the problem. 🤔

For now, I can confirm this issue.

@KarolDawidziuk KarolDawidziuk added status:confirmed An issue confirmed by the development team. type:bug A bug. and removed stale The issue / PR will be closed within the next 7 days of inactivity. labels May 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:confirmed An issue confirmed by the development team. type:bug A bug.
Projects
None yet
Development

No branches or pull requests

2 participants