Skip to content

Commit

Permalink
update search block icon button
Browse files Browse the repository at this point in the history
  • Loading branch information
scruffian committed Apr 12, 2022
1 parent f70a413 commit 9094d37
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions packages/block-editor/src/components/block-button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ export default class BlockButton extends Component {
const newProps = { ...this.props };
newProps.className += ' wp-element-button';

// If children are set then we only need a button, not RichText.
if ( newProps.children ) {
return <button { ...newProps } />;
}

if ( this.props.frontEnd ) {
return <RichText.Content { ...newProps } />;
}
Expand Down
6 changes: 3 additions & 3 deletions packages/block-library/src/search/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ export default function SearchEdit( {

return (
<>
{ buttonUseIcon && ( // TODO
<button
{ buttonUseIcon && (
<BlockButton
type="button"
className={ buttonClasses }
style={ buttonStyles }
Expand All @@ -266,7 +266,7 @@ export default function SearchEdit( {
}
>
<Icon icon={ search } />
</button>
</BlockButton>
) }

{ ! buttonUseIcon && (
Expand Down

0 comments on commit 9094d37

Please sign in to comment.