Skip to content

Commit

Permalink
Remove keepPlaceholderOnFocus
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Jul 24, 2019
1 parent f4f6397 commit c8334ee
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 15 deletions.
2 changes: 0 additions & 2 deletions docs/designers-developers/developers/richtext.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ wp.blocks.registerBlockType( /* ... */, {
props.setAttributes( { content: content } ); // Store updated content as a block attribute
},
placeholder: __( 'Heading...' ), // Display this text before any content has been added by the user
keepPlaceholderOnFocus: true // Keep the placeholder text showing even when the field is focused (leave this property off to remove placeholder content on focus)
} );
},

Expand Down Expand Up @@ -85,7 +84,6 @@ registerBlockType( /* ... */, {
formattingControls={ [ 'bold', 'italic' ] } // Allow the content to be made bold or italic, but do not allow other formatting options
onChange={ ( content ) => setAttributes( { content } ) } // Store updated content as a block attribute
placeholder={ __( 'Heading...' ) } // Display this text before any content has been added by the user
keepPlaceholderOnFocus // Keep the placeholder text showing even when the field is focused (leave this property off to remove placeholder content on focus)
/>
);
},
Expand Down
4 changes: 0 additions & 4 deletions packages/block-editor/src/components/rich-text/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ Render a rich [`contenteditable` input](https://developer.mozilla.org/en-US/docs

*Optional.* Whether to show the input is selected or not in order to show the formatting controls. By default it renders the controls when the block is selected.

### `keepPlaceholderOnFocus: Boolean`

*Optional.* By default, the placeholder will hide as soon as the editable field receives focus. With this setting it can be be kept while the field is focussed and empty.

### `autocompleters: Array<Completer>`

*Optional.* A list of autocompleters to use instead of the default.
Expand Down
2 changes: 0 additions & 2 deletions packages/block-editor/src/components/rich-text/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ class RichTextWrapper extends Component {
isSelected: originalIsSelected,
onCreateUndoLevel,
placeholder,
keepPlaceholderOnFocus,
// eslint-disable-next-line no-unused-vars
allowedFormats,
withoutInteractiveFormatting,
Expand Down Expand Up @@ -340,7 +339,6 @@ class RichTextWrapper extends Component {
wrapperClassName={ classnames( wrapperClasses, wrapperClassName ) }
className={ classnames( classes, className ) }
placeholder={ placeholder }
keepPlaceholderOnFocus={ keepPlaceholderOnFocus }
allowedFormats={ adjustedAllowedFormats }
withoutInteractiveFormatting={ withoutInteractiveFormatting }
onEnter={ this.onEnter }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ function RichTextWraper( {
isSelected: originalIsSelected,
onCreateUndoLevel,
placeholder,
keepPlaceholderOnFocus,
// From experimental filter.
...experimentalProps
} ) {
Expand All @@ -68,7 +67,6 @@ function RichTextWraper( {
wrapperClassName={ classnames( wrapperClasses, wrapperClassName ) }
className={ classnames( classes, className ) }
placeholder={ placeholder }
keepPlaceholderOnFocus={ keepPlaceholderOnFocus }
__unstableIsSelected={ originalIsSelected }
//__unstablePatterns={ getPatterns() }
//__unstableEnterPatterns={ getEnterPatterns() }
Expand Down
1 change: 0 additions & 1 deletion packages/block-library/src/button/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ class ButtonEdit extends Component {
backgroundColor: backgroundColor.color,
color: textColor.color,
} }
keepPlaceholderOnFocus
/>
<BaseControl
label={ __( 'Link' ) }
Expand Down
2 changes: 0 additions & 2 deletions packages/block-library/src/file/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ class FileEdit extends Component {
tagName="div" // must be block-level or else cursor disappears
value={ fileName }
placeholder={ __( 'Write file name…' ) }
keepPlaceholderOnFocus
withoutInteractiveFormatting
onChange={ ( text ) => setAttributes( { fileName: text } ) }
/>
Expand All @@ -225,7 +224,6 @@ class FileEdit extends Component {
value={ downloadButtonText }
withoutInteractiveFormatting
placeholder={ __( 'Add text…' ) }
keepPlaceholderOnFocus
onChange={ ( text ) => setAttributes( { downloadButtonText: text } ) }
/>
</div>
Expand Down
2 changes: 0 additions & 2 deletions packages/block-library/src/search/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export default function SearchEdit( { className, attributes, setAttributes } ) {
wrapperClassName="wp-block-search__label"
aria-label={ __( 'Label text' ) }
placeholder={ __( 'Add label…' ) }
keepPlaceholderOnFocus
withoutInteractiveFormatting
value={ label }
onChange={ ( html ) => setAttributes( { label: html } ) }
Expand All @@ -33,7 +32,6 @@ export default function SearchEdit( { className, attributes, setAttributes } ) {
className="wp-block-search__button-rich-text"
aria-label={ __( 'Button text' ) }
placeholder={ __( 'Add button text…' ) }
keepPlaceholderOnFocus
withoutInteractiveFormatting
value={ buttonText }
onChange={ ( html ) => setAttributes( { buttonText: html } ) }
Expand Down

0 comments on commit c8334ee

Please sign in to comment.