Skip to content

Commit

Permalink
Progress Bar: Replace max value range control with number control
Browse files Browse the repository at this point in the history
Updates the maximum value field in the Progress Bar block from a RangeControl to NumberControl, allowing for more flexible value input. Also adjusts the minimum height constraint from 6px to 1px for finer control over bar appearance. Adds shift+arrow key support for increments of 10.
  • Loading branch information
Infinite-Null committed Jan 22, 2025
1 parent dcf5034 commit 7470909
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/block-library/src/progress-bar/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
useBlockProps,
} from '@wordpress/block-editor';
import {
__experimentalNumberControl as NumberControl,
RangeControl,
SelectControl,
TextControl,
Expand Down Expand Up @@ -102,16 +103,16 @@ export default function Edit( { attributes, setAttributes } ) {
hasValue={ () => max !== 100 }
onDeselect={ () => setAttributes( { max: 100 } ) }
>
<RangeControl
<NumberControl
__next40pxDefaultSize
__nextHasNoMarginBottom
isShiftStepEnabled
shiftStep={ 10 }
label={ __( 'Maximum Value' ) }
value={ max }
onChange={ ( maxValue ) =>
setAttributes( { max: maxValue } )
}
min={ 1 }
max={ 1000 }
/>
</ToolsPanelItem>
<ToolsPanelItem
Expand All @@ -129,7 +130,7 @@ export default function Edit( { attributes, setAttributes } ) {
onChange={ ( heightValue ) =>
setAttributes( { height: heightValue } )
}
min={ 6 }
min={ 1 }
max={ 30 }
/>
</ToolsPanelItem>
Expand Down

0 comments on commit 7470909

Please sign in to comment.