Skip to content

Commit

Permalink
Fix usage in DimensionsPanel
Browse files Browse the repository at this point in the history
  • Loading branch information
mirka committed Nov 26, 2024
1 parent 04c4e53 commit 331c5d8
Showing 1 changed file with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -444,17 +444,6 @@ export default function DimensionsPanel( {

const onMouseLeaveControls = () => onVisualize( false );

const inputProps = {
min: minMarginValue,
onDragStart: () => {
//Reset to 0 in case the value was negative.
setMinMarginValue( 0 );
},
onDragEnd: () => {
setMinMarginValue( minimumMargin );
},
};

return (
<Wrapper
resetAllFilter={ resetAllFilter }
Expand Down Expand Up @@ -545,8 +534,10 @@ export default function DimensionsPanel( {
units={ units }
allowReset={ false }
splitOnAxis={ isAxialPadding }
onMouseOver={ onMouseOverPadding }
onMouseOut={ onMouseLeaveControls }
inputProps={ {
onMouseOver: onMouseOverPadding,
onMouseOut: onMouseLeaveControls,
} }
/>
) }
{ showSpacingPresetsControl && (
Expand Down Expand Up @@ -581,14 +572,23 @@ export default function DimensionsPanel( {
__next40pxDefaultSize
values={ marginValues }
onChange={ setMarginValues }
inputProps={ inputProps }
inputProps={ {
min: minMarginValue,
onDragStart: () => {
// Reset to 0 in case the value was negative.
setMinMarginValue( 0 );
},
onDragEnd: () => {
setMinMarginValue( minimumMargin );
},
onMouseOver: onMouseOverMargin,
onMouseOut: onMouseLeaveControls,
} }
label={ __( 'Margin' ) }
sides={ marginSides }
units={ units }
allowReset={ false }
splitOnAxis={ isAxialMargin }
onMouseOver={ onMouseOverMargin }
onMouseOut={ onMouseLeaveControls }
/>
) }
{ showSpacingPresetsControl && (
Expand Down

0 comments on commit 331c5d8

Please sign in to comment.