@@ -298,7 +298,7 @@ export const NumberInput = forwardRef(
298298 [ localRef , min , onChange ] ,
299299 )
300300
301- const isMinusDisabled = useMemo ( ( ) => {
301+ const isMinusDisabled = useCallback ( ( ) => {
302302 if ( ! localRef ?. current ?. value || localRef ?. current ?. value === '' ) {
303303 return false
304304 }
@@ -313,7 +313,7 @@ export const NumberInput = forwardRef(
313313 return Number . isNaN ( numericValue ) || numericValue <= minValue
314314 } , [ localRef ?. current ?. value , min ] )
315315
316- const isPlusDisabled = useMemo ( ( ) => {
316+ const isPlusDisabled = useCallback ( ( ) => {
317317 if ( ! localRef ?. current ?. value || localRef ?. current ?. value === '' ) {
318318 return false
319319 }
@@ -344,6 +344,10 @@ export const NumberInput = forwardRef(
344344 if ( value !== undefined ) {
345345 inputValue =
346346 value !== null && typeof value === 'number' ? value . toString ( ) : ''
347+
348+ if ( localRef . current ) {
349+ localRef . current . value = inputValue
350+ }
347351 }
348352
349353 return (
@@ -377,7 +381,7 @@ export const NumberInput = forwardRef(
377381 >
378382 < Button
379383 aria-label = "minus"
380- disabled = { disabled || readOnly || isMinusDisabled }
384+ disabled = { disabled || readOnly || isMinusDisabled ( ) }
381385 onClick = { onClickSideButton ( 'down' ) }
382386 sentiment = "neutral"
383387 size = { size === 'small' ? 'xsmall' : 'small' }
@@ -451,7 +455,7 @@ export const NumberInput = forwardRef(
451455 >
452456 < Button
453457 aria-label = "plus"
454- disabled = { disabled || readOnly || isPlusDisabled }
458+ disabled = { disabled || readOnly || isPlusDisabled ( ) }
455459 onClick = { onClickSideButton ( 'up' ) }
456460 sentiment = "neutral"
457461 size = { size === 'small' ? 'xsmall' : 'small' }
0 commit comments