Skip to content

Commit

Permalink
Grid interactivity: Show grid visualizer when block inspector is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
noisysocks committed May 13, 2024
1 parent 406f4b7 commit a78de10
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/block-editor/src/layouts/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export default {
inspectorControls: function GridLayoutInspectorControls( {
layout = {},
onChange,
clientId,
layoutBlockSupport = {},
} ) {
const { allowSizingOnChildren = false } = layoutBlockSupport;
Expand All @@ -90,14 +89,14 @@ export default {
onChange={ onChange }
/>
) }
{ window.__experimentalEnableGridInteractivity && (
<GridVisualizer clientId={ clientId } />
) }
</>
);
},
toolBarControls: function GridLayoutToolbarControls() {
return null;
toolBarControls: function GridLayoutToolbarControls( { clientId } ) {
if ( ! window.__experimentalEnableGridInteractivity ) {
return null;
}
return <GridVisualizer clientId={ clientId } />;
},
getLayoutStyle: function getLayoutStyle( {
selector,
Expand Down Expand Up @@ -136,7 +135,7 @@ export default {
} else if ( minimumColumnWidth ) {
rules.push(
`grid-template-columns: repeat(auto-fill, minmax(min(${ minimumColumnWidth }, 100%), 1fr))`,
`container-type: inline-size`
'container-type: inline-size'
);
}

Expand Down

0 comments on commit a78de10

Please sign in to comment.