Skip to content

Commit

Permalink
Make the block Remove button appear on focus. (#6279)
Browse files Browse the repository at this point in the history
* Make the block Remove button appear on focus.

* Pass ...props.
  • Loading branch information
afercia authored Apr 19, 2018
1 parent 7168a78 commit 473ef22
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion editor/components/block-settings-menu/block-remove-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { compose } from '@wordpress/element';
import { withDispatch } from '@wordpress/data';
import { withEditorSettings } from '@wordpress/blocks';

export function BlockRemoveButton( { onRemove, onClick = noop, isLocked, role } ) {
export function BlockRemoveButton( { onRemove, onClick = noop, isLocked, role, ...props } ) {
if ( isLocked ) {
return null;
}
Expand All @@ -26,6 +26,7 @@ export function BlockRemoveButton( { onRemove, onClick = noop, isLocked, role }
icon="trash"
label={ label }
role={ role }
{ ...props }
/>
);
}
Expand Down
6 changes: 5 additions & 1 deletion editor/components/block-settings-menu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ export class BlockSettingsMenu extends Component {
</NavigableMenu>
) }
/>
<BlockRemoveButton uids={ uids } />
<BlockRemoveButton
uids={ uids }
onFocus={ this.onFocus }
onBlur={ this.onBlur }
/>
</div>
);
}
Expand Down

0 comments on commit 473ef22

Please sign in to comment.