ckeditor4-vue icon indicating copy to clipboard operation
ckeditor4-vue copied to clipboard

Input event is not emitted when the value changes to its initial value (value props)

Open HundredBeans opened this issue 2 years ago • 1 comments

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

  1. Set initial value to anything and pass it to the editor as value props. E.g: empty string ('')
  2. Add a method to handle the emitted input event to see if the input event is emitted
  3. 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.

HundredBeans avatar Aug 31 '22 09:08 HundredBeans

Hi @HundredBeans and thank you for the report.

I can confirm this issue.

KarolDawidziuk avatar Aug 31 '22 13:08 KarolDawidziuk