@@ -154,11 +154,13 @@ export const useSpinButton_unstable = (props: SpinButtonProps, ref: React.Ref<HT
154
154
} ;
155
155
156
156
const handleIncrementMouseDown = ( e : React . MouseEvent < HTMLButtonElement > ) => {
157
+ commit ( e , currentValue , textValue ) ;
157
158
internalState . current . spinState = 'up' ;
158
159
stepValue ( e , 'up' ) ;
159
160
} ;
160
161
161
162
const handleDecrementMouseDown = ( e : React . MouseEvent < HTMLButtonElement > ) => {
163
+ commit ( e , currentValue , textValue ) ;
162
164
internalState . current . spinState = 'down' ;
163
165
stepValue ( e , 'down' ) ;
164
166
} ;
@@ -231,10 +233,12 @@ export const useSpinButton_unstable = (props: SpinButtonProps, ref: React.Ref<HT
231
233
if ( valueChanged ) {
232
234
roundedValue = precisionRound ( newValue ! , precision ) ;
233
235
setCurrentValue ( roundedValue ) ;
236
+ internalState . current . value = roundedValue ;
234
237
} else if ( displayValueChanged && ! isControlled ) {
235
238
const nextValue = parseFloat ( newDisplayValue as string ) ;
236
239
if ( ! isNaN ( nextValue ) ) {
237
240
setCurrentValue ( precisionRound ( nextValue , precision ) ) ;
241
+ internalState . current . value = precisionRound ( nextValue , precision ) ;
238
242
}
239
243
}
240
244
@@ -323,6 +327,7 @@ export const useSpinButton_unstable = (props: SpinButtonProps, ref: React.Ref<HT
323
327
state . input [ 'aria-valuemax' ] = max ;
324
328
state . input [ 'aria-valuetext' ] = state . input [ 'aria-valuetext' ] ?? ( ( value !== undefined && displayValue ) || undefined ) ;
325
329
state . input . onChange = mergeCallbacks ( state . input . onChange , handleInputChange ) ;
330
+ state . input . onInput = mergeCallbacks ( state . input . onInput , handleInputChange ) ;
326
331
state . input . onBlur = mergeCallbacks ( state . input . onBlur , handleBlur ) ;
327
332
state . input . onKeyDown = mergeCallbacks ( state . input . onKeyDown , handleKeyDown ) ;
328
333
state . input . onKeyUp = mergeCallbacks ( state . input . onKeyUp , handleKeyUp ) ;
0 commit comments