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

The editor ngModel is not updated when native spellchecking correction applied

Open f1ames opened this issue 6 years ago • 2 comments

Are you reporting a feature request or a bug?

Bug

Provide detailed reproduction steps (if any)

  1. Go to any CKEditor 4 Angular sample with native spellchecking enabled. I have tested it on our form sample.
  2. Type some incorrect test.
  3. Apply incorrect word correction via native context menu.

Expected result

Editor ngModel is updated and contains latest changes.

Actual result

Editor ngModel is not updated.

angular

Other details

  • Browser: Tested on Chrome
  • OS: macOS
  • Integration version: 1.0.0-beta.2
  • CKEditor version: 4.12
  • Installed CKEditor plugins: -

f1ames avatar Aug 21 '19 08:08 f1ames

This is CKEditor 4 issue related to a fact that change event is not triggered by applying native grammar correction - https://github.com/ckeditor/ckeditor-dev/issues/2384.

f1ames avatar Aug 21 '19 08:08 f1ames

The quick workaround for this issue would be to manually trigger change event as suggested in https://github.com/ckeditor/ckeditor-dev/issues/2384:

<ckeditor
    [config]="{ disableNativeSpellChecker: false, on: { instanceReady: triggerChangeEvent } }">
</ckeditor>

were triggerChangeEvent should be defined as follows:

triggerChangeEvent( evt ) {
	const editor = evt.editor;
	editor.editable().$.addEventListener( 'input', function( evt ) {
		if ( 'insertReplacementText' === evt.inputType ) {
			editor.fire( 'change' );
		}
	} );
}

f1ames avatar Aug 21 '19 12:08 f1ames