Skip to content

Commit

Permalink
removed the edit button cell when it's not editable
Browse files Browse the repository at this point in the history
  • Loading branch information
MaggieCabrera committed Dec 9, 2022
1 parent 2c57000 commit ca41b20
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions packages/block-editor/src/components/off-canvas-editor/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,27 +325,28 @@ function ListViewBlock( {

{ showBlockActions && (
<>
<TreeGridCell
className={ listViewBlockEditClassName }
aria-selected={
!! isSelected || forceSelectionContentLock
}
>
{ ( props ) =>
isEditable && (
{ isEditable && (
<TreeGridCell
className={ listViewBlockEditClassName }
aria-selected={
!! isSelected || forceSelectionContentLock
}
>
{ ( props ) => (
<BlockEditButton
{ ...props }
label={ editAriaLabel }
clientId={ clientId }
/>
)
}
</TreeGridCell>
) }
</TreeGridCell>
) }
<TreeGridCell
className={ listViewBlockSettingsClassName }
aria-selected={
!! isSelected || forceSelectionContentLock
}
colSpan={ isEditable ? 1 : 2 } // When an item is not editable then we don't output the cell for the edit button, so we need to adjust the colspan so that the HTML is valid.
>
{ ( { ref, tabIndex, onFocus } ) => (
<BlockSettingsDropdown
Expand Down

0 comments on commit ca41b20

Please sign in to comment.