Forráskód Böngészése

Internal: Fixed an when focusing a different widget from a blurred editor.

See https://github.com/ckeditor/ckeditor5-engine/pull/1792#issuecomment-529814641 for more information.
Marek Lewandowski 6 éve
szülő
commit
0e35be9bf9
1 módosított fájl, 6 hozzáadás és 3 törlés
  1. 6 3
      packages/ckeditor5-engine/src/view/renderer.js

+ 6 - 3
packages/ckeditor5-engine/src/view/renderer.js

@@ -690,13 +690,16 @@ export default class Renderer {
 	 * @param {HTMLElement} domRoot A valid DOM root where the fake selection container should be added.
 	 * @param {HTMLElement} domRoot A valid DOM root where the fake selection container should be added.
 	 */
 	 */
 	_updateFakeSelection( domRoot ) {
 	_updateFakeSelection( domRoot ) {
+		const domDocument = domRoot.ownerDocument;
+		let container = this._fakeSelectionContainer;
+
 		if ( !this._fakeSelectionNeedsUpdate( domRoot ) ) {
 		if ( !this._fakeSelectionNeedsUpdate( domRoot ) ) {
+			// Container did not change, but the selection might point a different element with same fake selection.
+			// See https://github.com/ckeditor/ckeditor5-engine/pull/1792#issuecomment-529814641.
+			this.domConverter.bindFakeSelection( container, this.selection );
 			return;
 			return;
 		}
 		}
 
 
-		const domDocument = domRoot.ownerDocument;
-		let container = this._fakeSelectionContainer;
-
 		// Create fake selection container if one does not exist.
 		// Create fake selection container if one does not exist.
 		if ( !container ) {
 		if ( !container ) {
 			this._fakeSelectionContainer = container = domDocument.createElement( 'div' );
 			this._fakeSelectionContainer = container = domDocument.createElement( 'div' );