ckeditor4-vue
ckeditor4-vue copied to clipboard
Input event is not emitted when the value changes to its initial value (value props)
Are you reporting a feature request or a bug?
Bug
Provide detailed reproduction steps (if any)
This issue/bug only happens when using the one-way binding using value props
- Set initial value to anything and pass it to the editor as value props. E.g: empty string ('')
- Add a method to handle the emitted input event to see if the input event is emitted
- Write something to the editor, and then change the editor to its initial value. E.g: If the initial value is an empty string, try to select all and delete the content inside the editor
Codesandbox link: https://codesandbox.io/s/ckeditor4-vue-bug-report-forked-khff87?file=/src/App.vue
Expected result
The input event should be emitted when there are changes in the editor
Actual result
The input event is not emitted when the editor content is equal to the passed value props
Other details
- Browser: …
- OS: …
- Integration version: …
- CKEditor version: …
- Installed CKEditor plugins: …
I saw in the code that the input event is only emitted when the change is not equal to the value props. https://github.com/ckeditor/ckeditor4-vue/blob/master/src/ckeditor.js#L145-L153 I guess that's the root cause. It is fine if the user is using two-way binding because the value is always changing.
Hi @HundredBeans and thank you for the report.
I can confirm this issue.