Преглед изворни кода

Simplfied the implementation.

Piotrek Koszuliński пре 8 година
родитељ
комит
3d1568cc07
1 измењених фајлова са 9 додато и 2 уклоњено
  1. 9 2
      packages/ckeditor5-engine/src/view/containerelement.js

+ 9 - 2
packages/ckeditor5-engine/src/view/containerelement.js

@@ -78,6 +78,13 @@ export default class ContainerElement extends Element {
 //
 // @returns {Number|null} Block filler offset or `null` if block filler is not needed.
 function getFillerOffset() {
-	// Render block filler at the end of element (after all ui elements).
-	return Array.from( this.getChildren() ).some( element => !element.is( 'uiElement' ) ) ? null : this.childCount;
+	for ( const child of this.getChildren() ) {
+		// If there's any non-UI element – don't render the bogus.
+		if ( !child.is( 'uiElement' ) ) {
+			return null;
+		}
+	}
+
+	// If there are only UI elements – render the bogus at the end of the element.
+	return this.childCount;
 }