Przeglądaj źródła

Remove all ranges if there is no view selection nor focus.

Piotr Jasiun 9 lat temu
rodzic
commit
ebe5670696
1 zmienionych plików z 4 dodań i 4 usunięć
  1. 4 4
      packages/ckeditor5-engine/src/view/renderer.js

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

@@ -419,10 +419,6 @@ export default class Renderer {
 	 * @private
 	 */
 	_updateSelection() {
-		if ( !this.isFocused ) {
-			return;
-		}
-
 		// If there is no selection - remove it from DOM elements that belongs to the editor.
 		if ( this.selection.rangeCount === 0 ) {
 			this._removeDomSelction();
@@ -430,6 +426,10 @@ export default class Renderer {
 			return;
 		}
 
+		if ( !this.isFocused ) {
+			return;
+		}
+
 		const selectedEditable = this.selection.getEditableElement();
 		const domRoot = this.domConverter.getCorrespondingDomElement( selectedEditable );