From ad182a582acdba15666ecfedcacd36039088c6a3 Mon Sep 17 00:00:00 2001 From: Jorge Date: Thu, 15 Feb 2018 13:04:52 +0000 Subject: [PATCH] Fixed RichText placeholder whitespace. (#5035) The RichText CSS uses a rule based on attribute data-is-placeholder-visible. The TinyMCE component was just setting this attribute when componentWillReceiveProps is invoked while it should also set on the first render for the first props received. --- .../button/test/__snapshots__/index.js.snap | 1 + .../heading/test/__snapshots__/index.js.snap | 1 + .../list/test/__snapshots__/index.js.snap | 1 + .../test/__snapshots__/index.js.snap | 1 + .../test/__snapshots__/index.js.snap | 1 + .../test/__snapshots__/index.js.snap | 1 + .../quote/test/__snapshots__/index.js.snap | 1 + .../test/__snapshots__/index.js.snap | 2 ++ .../verse/test/__snapshots__/index.js.snap | 1 + blocks/rich-text/tinymce.js | 26 +++++++++++-------- 10 files changed, 25 insertions(+), 11 deletions(-) diff --git a/blocks/library/button/test/__snapshots__/index.js.snap b/blocks/library/button/test/__snapshots__/index.js.snap index 02ccb119e2de08..c90afe81797fe8 100644 --- a/blocks/library/button/test/__snapshots__/index.js.snap +++ b/blocks/library/button/test/__snapshots__/index.js.snap @@ -11,6 +11,7 @@ exports[`core/button block edit matches snapshot 1`] = ` aria-label="Add text…" class="wp-block-button__link blocks-rich-text__tinymce" contenteditable="true" + data-is-placeholder-visible="true" />

         

     this.editorNode = node,
    -			contentEditable: true,
    -			suppressContentEditableWarning: true,
    +			...ariaProps,
     			className: classnames( className, 'blocks-rich-text__tinymce' ),
    +			contentEditable: true,
    +			[ IS_PLACEHOLDER_VISIBLE_ATTR_NAME ]: isPlaceholderVisible,
    +			ref: ( node ) => this.editorNode = node,
     			style,
    -			...ariaProps,
    +			suppressContentEditableWarning: true,
     		}, children );
     	}
     }