File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -232,7 +232,7 @@ function calculateNewValue(
232
232
233
233
const reachedMin = value === node . min
234
234
if ( inputData === 'ArrowDown' && ! reachedMin ) {
235
- newValue = ( Number ( value ) - 1 ) . toString ( )
235
+ newValue = ( Number ( value ) - step ) . toString ( )
236
236
}
237
237
}
238
238
Original file line number Diff line number Diff line change @@ -443,3 +443,15 @@ test("increments number input's value by the defined steps when pressing the arr
443
443
444
444
expect ( element ) . toHaveValue ( 20 )
445
445
} )
446
+
447
+ test ( "decrements number input's value by the defined steps when pressing the arrow down key" , ( ) => {
448
+ const { element} = render < HTMLInputElement > (
449
+ `<input value="10" type="number" step="10"/>` ,
450
+ )
451
+
452
+ const instance = setupInstance ( )
453
+
454
+ instance . dispatchUIEvent ( element , 'keydown' , { key : 'ArrowDown' } )
455
+
456
+ expect ( element ) . toHaveValue ( 0 )
457
+ } )
You can’t perform that action at this time.
0 commit comments