ckeditor / ckeditor4

The best enterprise-grade WYSIWYG editor. Fully customizable with countless features and plugins.
https://ckeditor.com/ckeditor-4
Other
5.8k stars 2.48k forks source link

When I input an emoji, the `change` event is not fired. #3950

Open iamsjy17 opened 4 years ago

iamsjy17 commented 4 years ago

Type of report

Bug

Provide detailed reproduction steps (if any)

  1. Launch URL: https://stackblitz.com/edit/js-j1a5lu?file=index.js
  2. Input an emoji (ctrl + cmd + space)
  3. Verify the issue.

In the example source above, when i input an emoji through the Mac os system input. the change event is not fired.

Alt onchange

Expected result

In general, when input through keyup, the change event fire.

Alt onchange

Actual result

Since entering an emoji also changes the data, the change event should occur generally, but it isn't.

https://github.com/ckeditor/ckeditor4/blob/d1710c198d8f5007e8d04fed9870bfd4b182ae54/plugins/undo/plugin.js#L1048

Looking at the ckeditor4 code, a change event is fired through the keyup method.

https://github.com/ckeditor/ckeditor4/blob/d1710c198d8f5007e8d04fed9870bfd4b182ae54/plugins/undo/plugin.js#L1001

However, the change event isn't fired through the input method.

Dumluregn commented 4 years ago

It seems we are indeed handling this improperly. input event in called but doesn't lead to firing change event, and it causes further failures, e.g. if you add emoji in described way and delete it, then editor creates inexecutable undo step: macos-emoji-undo