Browse Source

Added styling to fake selection container andd binding it to current view selection.

Szymon Kupś 9 năm trước cách đây
mục cha
commit
fdcc8b5e7f
1 tập tin đã thay đổi với 7 bổ sung1 xóa
  1. 7 1
      packages/ckeditor5-engine/src/view/renderer.js

+ 7 - 1
packages/ckeditor5-engine/src/view/renderer.js

@@ -464,10 +464,13 @@ export default class Renderer {
 		// Create fake selection container if one does not exist.
 		if ( this._fakeSelectionContainer === null ) {
 			this._fakeSelectionContainer = domDocument.createElement( 'div' );
+			this._fakeSelectionContainer.style.position = 'fixed';
+			this._fakeSelectionContainer.style.top = 0;
+			this._fakeSelectionContainer.style.left = '-1000px';
 		}
 
 		// Add fake container if not already added.
-		if (  this._fakeSelectionContainer.parentElement === null ) {
+		if ( this._fakeSelectionContainer.parentElement === null ) {
 			domRoot.appendChild( this._fakeSelectionContainer );
 		}
 
@@ -484,6 +487,9 @@ export default class Renderer {
 		const domRange = new Range();
 		domRange.selectNodeContents( this._fakeSelectionContainer );
 		domSelection.addRange( domRange );
+
+		// Bind fake selection container with current selection.
+		this.domConverter.bindFakeSelection( this._fakeSelectionContainer, this.selection );
 	}
 
 	/**