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

Editor crashes after toggling the read only mode while the selection is inside the editor #1530

Closed
Mgsy opened this issue Feb 14, 2019 · 2 comments
Assignees
Labels
type:bug This issue reports a buggy (incorrect) behavior.
Milestone

Comments

@Mgsy
Copy link
Member

Mgsy commented Feb 14, 2019

Is this a bug report or feature request? (choose one)

🐞 Bug report

💻 Version of CKEditor

Latest master.

📋 Steps to reproduce

  1. Open the article sample.
  2. Paste the following code to the console:
document.addEventListener( 'keydown', evt => {
    if ( evt.keyCode == '16' ) {
      editor.isReadOnly == true ? editor.isReadOnly = false : editor.isReadOnly = true;
    } 
} );
  1. Put the caret inside the editor.
  2. Press Shift twice.

✅ Expected result

There's no error in the console.

❎ Actual result

The editor crashes.

📃 Other details that might be useful

Error

ckeditorerror.js:46 Uncaught CKEditorError: cannot-change-view-tree: Attempting to make changes to the view when it is in an incorrect state: rendering or post-fixers are in progress. This may cause some unexpected behavior and inconsistency between the DOM and the view. Read more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-cannot-change-view-tree
    at View.change (http://192.168.1.48:8125/ckeditor5-core/tests/manual/article.js:78039:10)
    at InlineEditableUIView._updateIsFocusedClasses (http://192.168.1.48:8125/ckeditor5-core/tests/manual/article.js:97005:15)
    at InlineEditableUIView.on (http://192.168.1.48:8125/ckeditor5-core/tests/manual/article.js:96981:43)
    at InlineEditableUIView.fire (http://192.168.1.48:8125/ckeditor5-core/tests/manual/article.js:107797:29)
    at InlineEditableUIView.set [as isFocused] (http://192.168.1.48:8125/ckeditor5-core/tests/manual/article.js:109682:11)
    at updateBoundObservableProperty (http://192.168.1.48:8125/ckeditor5-core/tests/manual/article.js:110219:30)
    at bindings.forEach.binding (http://192.168.1.48:8125/ckeditor5-core/tests/manual/article.js:110246:7)
    at Set.forEach (<anonymous>)
    at FocusTracker.observable.listenTo (http://192.168.1.48:8125/ckeditor5-core/tests/manual/article.js:110245:15)
    at FocusTracker.fire (http://192.168.1.48:8125/ckeditor5-core/tests/manual/article.js:107797:29)

Notes

  • It doesn't occur if the selection is outside of the editor.
  • It's a regression.
  • It could be easly reproduced with the collaboration. User is typing -> losing connection -> editor goes read only -> connection is restored -> editor leaves the read only mode -> crash.
@Mgsy Mgsy added type:bug This issue reports a buggy (incorrect) behavior. status:confirmed labels Feb 14, 2019
@Mgsy
Copy link
Member Author

Mgsy commented Feb 14, 2019

cc @oskarwrobel

@oskarwrobel oskarwrobel added this to the iteration 22 milestone Feb 18, 2019
@oskarwrobel oskarwrobel self-assigned this Feb 18, 2019
pjasiun pushed a commit to ckeditor/ckeditor5-engine that referenced this issue Feb 18, 2019
Feature: Introduce read-only `View#isRenderingInProgress` flag to check if the document is in the rendering phase. Closes ckeditor/ckeditor5#1530.
pjasiun pushed a commit to ckeditor/ckeditor5-ui that referenced this issue Feb 18, 2019
Fix: Prevented from changing the view document during the render phase. Closes ckeditor/ckeditor5#1530.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

No branches or pull requests

2 participants