Skip to content

Commit

Permalink
Revert "removed the edit button cell when it's not editable (#46439)" (
Browse files Browse the repository at this point in the history
…#47061)

This reverts commit 78deee0.
  • Loading branch information
scruffian authored Jan 12, 2023
1 parent 5442553 commit 8ec6493
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions packages/block-editor/src/components/off-canvas-editor/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,28 +331,27 @@ function ListViewBlock( {

{ showBlockActions && (
<>
{ isEditable && (
<TreeGridCell
className={ listViewBlockEditClassName }
aria-selected={
!! isSelected || forceSelectionContentLock
}
>
{ ( props ) => (
<TreeGridCell
className={ listViewBlockEditClassName }
aria-selected={
!! isSelected || forceSelectionContentLock
}
>
{ ( props ) =>
isEditable && (
<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 } ) => (
<>
Expand Down

0 comments on commit 8ec6493

Please sign in to comment.