8
0
فهرست منبع

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;
 }