Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Focus the new editing host to workaround FF's errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinmar committed Jan 18, 2018
1 parent ee88389 commit 2c1d073
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/view/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,10 @@ export default class Renderer {
const anchor = this.domConverter.viewPositionToDom( this.selection.anchor );
const focus = this.domConverter.viewPositionToDom( this.selection.focus );

// Focus the new editing host.
// Otherwise, FF may throw an error (https://github.com/ckeditor/ckeditor5/issues/721).
domRoot.focus();

domSelection.collapse( anchor.parent, anchor.offset );
domSelection.extend( focus.parent, focus.offset );
}
Expand Down

0 comments on commit 2c1d073

Please sign in to comment.