Skip to content

Commit

Permalink
Bring back range control when experiment is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
tellthemachines committed Jun 25, 2024
1 parent c12b098 commit c80ce4d
Showing 1 changed file with 32 additions and 16 deletions.
48 changes: 32 additions & 16 deletions packages/block-editor/src/layouts/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,23 +275,39 @@ function GridLayoutColumnsAndRowsControl( {
label={ __( 'Columns' ) }
/>
</FlexItem>
{ allowSizingOnChildren &&
window.__experimentalEnableGridInteractivity && (
<FlexItem isBlock>
<NumberControl
size="__unstable-large"
onChange={ ( value ) => {
onChange( {
...layout,
rowCount: value,
} );
} }
value={ rowCount }
min={ 1 }
label={ __( 'Rows' ) }
/>
</FlexItem>

<FlexItem isBlock>
{ window.__experimentalEnableGridInteractivity &&
allowSizingOnChildren ? (
<NumberControl
size="__unstable-large"
onChange={ ( value ) => {
onChange( {
...layout,
rowCount: value,
} );
} }
value={ rowCount }
min={ 1 }
label={ __( 'Rows' ) }
/>
) : (
<RangeControl
value={ parseInt( columnCount, 10 ) } // RangeControl can't deal with strings.
onChange={ ( value ) =>
onChange( {
...layout,
columnCount: value,
} )
}
min={ 1 }
max={ 16 }
withInputField={ false }
label={ __( 'Columns' ) }
hideLabelFromVision
/>
) }
</FlexItem>
</Flex>
</fieldset>
</>
Expand Down

0 comments on commit c80ce4d

Please sign in to comment.