Freeze browser with SourceEditing plugin
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:
- Click to "Source" button
- Write some text (important)
- Click the "Toggle" button.
- 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
Same issue! If you press the source button & edit some text, after pressing save, the browser crashes.
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
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;
}
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!
Could we verify if the issue is solved using the nightly builds?
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.