-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Labels
support:2An issue reported by a commercially licensed client.An issue reported by a commercially licensed client.type:bugThis issue reports a buggy (incorrect) behavior.This issue reports a buggy (incorrect) behavior.
Milestone
Description
📝 Provide detailed reproduction steps (if any)
- Add a button to the manual test after an editor with the following handler attached:
document.querySelector( '#save' ).addEventListener( 'click', e => {
e.preventDefault();
editor.enableReadOnlyMode( 'saving' );
editor.setData( '' );
window.document.dispatchEvent( new window.Event( 'selectionchange' ) );
editor.disableReadOnlyMode( 'saving' );
editor.focus();
} );
- In the editor select an image
- Click created button
✔️ Expected result
Editor content is cleared and editor does not crash.
❌ Actual result
Editor crashes with the _handleSelectionChange
in the stack trace.
❓ Possible solution
While debugging I noticed that the fake selection container <-> view selection map is not verified if the selection is still valid and tries to convert an invalid cached selection to model:
const viewSelection = this.fakeSelectionToView( container as DomElement ); |
📃 Other details
- Browser: …
- OS: …
- First affected CKEditor version: …
- Installed CKEditor plugins: …
If you'd like to see this fixed sooner, add a 👍 reaction to this post.
jbalinski and GDDanielCatalinIlie
Metadata
Metadata
Assignees
Labels
support:2An issue reported by a commercially licensed client.An issue reported by a commercially licensed client.type:bugThis issue reports a buggy (incorrect) behavior.This issue reports a buggy (incorrect) behavior.