Skip to content

Commit

Permalink
Revert "Allow negative values for margin inputs (#40464)" (#40674)
Browse files Browse the repository at this point in the history
This reverts commit a109d31.

Co-authored-by: Justin Ahinon <[email protected]>
  • Loading branch information
aristath and JustinyAhin authored Apr 28, 2022
1 parent 9913665 commit 30532e6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
1 change: 0 additions & 1 deletion packages/block-editor/src/hooks/margin.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ export function MarginEdit( props ) {
units={ units }
allowReset={ false }
splitOnAxis={ splitOnAxis }
allowNegativeValues={ true }
/>
</>
),
Expand Down
5 changes: 1 addition & 4 deletions packages/components/src/box-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function useUniqueId( idProp ) {
}
export default function BoxControl( {
id: idProp,
inputProps,
inputProps = defaultInputProps,
onChange = noop,
label = __( 'Box Control' ),
values: valuesProp,
Expand All @@ -55,10 +55,7 @@ export default function BoxControl( {
splitOnAxis = false,
allowReset = true,
resetValues = DEFAULT_VALUES,
allowNegativeValues = false,
} ) {
inputProps = allowNegativeValues ? { min: -Infinity } : defaultInputProps;

const [ values, setValues ] = useControlledState( valuesProp, {
fallback: DEFAULT_VALUES,
} );
Expand Down

0 comments on commit 30532e6

Please sign in to comment.