Browse Source

Focus the new editing host to workaround FF's errors.

Piotrek Koszuliński 8 years ago
parent
commit
106a780539
1 changed files with 4 additions and 0 deletions
  1. 4 0
      packages/ckeditor5-engine/src/view/renderer.js

+ 4 - 0
packages/ckeditor5-engine/src/view/renderer.js

@@ -628,6 +628,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 );
 	}