Skip to content

Commit

Permalink
Fix edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Dec 9, 2024
1 parent df9490d commit 27c4540
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/components/src/box-control/input-control.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ export default function BoxInputControl( {
: selectedUnits[ defaultValuesToModify[ 0 ] ];
const generatedId = useInstanceId( BoxInputControl, 'box-control-input' );
const inputId = [ generatedId, side ].join( '-' );
const usedValue =
mergedValue === undefined && computedUnit ? computedUnit : mergedValue;

return (
<InputWrapper key={ `box-control-${ side }` } expanded>
Expand All @@ -151,7 +153,7 @@ export default function BoxInputControl( {
className="component-box-control__unit-control"
id={ inputId }
isPressEnterToChange
value={ mergedValue }
value={ usedValue }
onChange={ handleOnValueChange }
onUnitChange={ handleOnUnitChange }
onFocus={ handleOnFocus }
Expand Down

0 comments on commit 27c4540

Please sign in to comment.