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

Freeze browser with SourceEditing plugin

Open annikeChe opened this issue 2 years ago • 6 comments

I use ckeditor5-angular with custom build configurations from official site customization with plugin SourceEditing. I get browser freezing when trying to destroy component with SourceEditing active mode (e.g. call routing.navigate() or change *ngIf param) I've got some example project for reproduce it.

Steps to reproduce:

  1. Click to "Source" button
  2. Write some text (important)
  3. Click the "Toggle" button.
  4. Get browser freezing

If you skip the (2) step all would be fine and browsers work great. Also, if you switch off source editing mode all would be fine too. Also I found out that you will get the same behavior if you call some functions which affect editor.fire() function (e.g. editorInstance.getData()) in the (3) step.

I tried to reproduce this behavior without angular (only with ckEditor with SourceEditing plugin) and I haven't got this behavior, all worked fine.

I use this packages:

"@angular/core": "~13.3.0",
"@ckeditor/ckeditor5-angular": "5.2.0",
"@ckeditor/ckeditor5-build-classic": "36.0.1",
"@ckeditor/ckeditor5-source-editing": "36.0.1"

Full project example you can see here

annikeChe avatar Mar 31 '23 10:03 annikeChe

Same issue! If you press the source button & edit some text, after pressing save, the browser crashes.

respectYourNeighbour avatar Apr 03 '23 13:04 respectYourNeighbour

As reported in https://github.com/ckeditor/ckeditor5/issues/11008

When I'm in SourceEditing mode, ngModel should be updated with click on button UPDATE SOURCE, but it isn't (Browser freeze) Here is the link to the code: https://github.com/aljaznuncic/testCkeditor

Witoso avatar Jun 20 '23 07:06 Witoso

As a workaround, you can switch to the editing mode after clicking your buttons, then call editor.getData().

For example:

sourceEditing: any;

toggleEditor() {
   this.sourceEditing = this.editor.plugins.get( 'SourceEditing' );
   this.sourceEditing.isSourceEditingMode = false;

   const data = this.editor.getData();

   this.showEditor = !this.showEditor;
}

Mgsy avatar Jul 12 '23 12:07 Mgsy

I wonder if our fix in the main repo ckeditor/ckeditor5#14469 will not solve this problem! This was reported to React integration as well, was identified as an issue in the core, and fixed. Will be available, most likely in the next release!

Witoso avatar Jul 12 '23 15:07 Witoso

Could we verify if the issue is solved using the nightly builds?

pomek avatar Jul 21 '23 06:07 pomek

I've updated @ckeditor packages to these versions:

├── @ckeditor/[email protected]
├── @ckeditor/[email protected]
├── @types/[email protected]

and I still have this problem. All changes commit into example repo.

annikeChe avatar Aug 22 '23 08:08 annikeChe