Explorar o código

Handled a special case. See ckeditor5/ckeditor5-typing#59's second TC in 2.js.

Piotrek Koszuliński %!s(int64=9) %!d(string=hai) anos
pai
achega
1f890490f0
Modificáronse 1 ficheiros con 9 adicións e 1 borrados
  1. 9 1
      packages/ckeditor5-engine/src/view/renderer.js

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

@@ -296,7 +296,15 @@ export default class Renderer {
 		// "FILLER{}"
 		// "FILLER{}"
 		// "FILLERadded-text{}"
 		// "FILLERadded-text{}"
 
 
-		const { parent: domParent } = this.domConverter.viewPositionToDom( this.selection.getFirstPosition() );
+		const selectionPosition = this.selection.getFirstPosition();
+
+		// If we cannot convert this position's parent it means that selection is in not yet rendered
+		// node, which means that the filler can't be there.
+		if ( !this.domConverter.getCorrespondingDom( selectionPosition.parent ) ) {
+			return false;
+		}
+
+		const { parent: domParent } = this.domConverter.viewPositionToDom( selectionPosition );
 
 
 		if ( this.domConverter.isText( domParent ) && startsWithFiller( domParent ) ) {
 		if ( this.domConverter.isText( domParent ) && startsWithFiller( domParent ) ) {
 			return true;
 			return true;