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

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

Open
HundredBeans opened this issue Aug 31, 2022 · 1 comment
Labels
status:confirmed An issue confirmed by the development team. type:bug A bug.

Comments

@HundredBeans
Copy link

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:/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.

@KarolDawidziuk
Copy link
Contributor

Hi @HundredBeans and thank you for the report.

I can confirm this issue.

@KarolDawidziuk KarolDawidziuk added type:bug A bug. status:confirmed An issue confirmed by the development team. labels Aug 31, 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