diff --git a/blocks/editable/index.js b/blocks/editable/index.js index 99b38488e63e2..4b66cfe7db52c 100644 --- a/blocks/editable/index.js +++ b/blocks/editable/index.js @@ -449,6 +449,7 @@ export default class Editable extends Component { // changes, we unmount and destroy the previous TinyMCE element, then // mount and initialize a new child element in its place. const key = [ 'editor', Tagname ].join(); + const isPlaceholderVisible = placeholder && this.state.empty; const classes = classnames( className, 'blocks-editable' ); const formatToolbar = ( @@ -478,11 +479,11 @@ export default class Editable extends Component { onSetup={ this.onSetup } style={ style } defaultValue={ value } - isEmpty={ this.state.empty } + isPlaceholderVisible={ isPlaceholderVisible } label={ placeholder } key={ key } /> - { this.state.empty && + { isPlaceholderVisible && setAttributes( { content: event.target.value } ) } + placeholder={ __( 'Write code…' ) } /> ); }, diff --git a/blocks/library/cover-image/index.js b/blocks/library/cover-image/index.js index a45a70a377b89..4d564be4a401a 100644 --- a/blocks/library/cover-image/index.js +++ b/blocks/library/cover-image/index.js @@ -114,7 +114,7 @@ registerBlockType( 'core/cover-image', { { title || !! focus ? ( , ]; }, diff --git a/blocks/library/preformatted/index.js b/blocks/library/preformatted/index.js index 6a90a051788a5..2f2bdd882e81e 100644 --- a/blocks/library/preformatted/index.js +++ b/blocks/library/preformatted/index.js @@ -56,6 +56,8 @@ registerBlockType( 'core/preformatted', { } } focus={ focus } onFocus={ setFocus } + placeholder={ __( 'Write preformatted text…' ) } + inline /> ); }, diff --git a/blocks/library/pullquote/index.js b/blocks/library/pullquote/index.js index ece11c67959d6..10e0a617ba82d 100644 --- a/blocks/library/pullquote/index.js +++ b/blocks/library/pullquote/index.js @@ -56,7 +56,7 @@ registerBlockType( 'core/pullquote', { value: nextValue, } ) } - placeholder={ __( 'Write Quote…' ) } + placeholder={ __( 'Write quote…' ) } focus={ focus && focus.editable === 'value' ? focus : null } onFocus={ ( props ) => setFocus( { ...props, editable: 'value' } ) } className="blocks-pullquote__content" diff --git a/blocks/library/quote/index.js b/blocks/library/quote/index.js index 9cf3496a8a68b..7d43dd6314ecc 100644 --- a/blocks/library/quote/index.js +++ b/blocks/library/quote/index.js @@ -152,12 +152,13 @@ registerBlockType( 'core/quote', { onFocus={ ( props ) => setFocus( { ...props, editable: 'value' } ) } onMerge={ mergeBlocks } style={ { textAlign: align } } + placeholder={ __( 'Write quote…' ) } /> { ( ( citation && citation.length > 0 ) || !! focus ) && ( setAttributes( { citation: nextCitation,