@@ -91,7 +91,7 @@ export function useColorArea(props: ColorAreaAriaProps, state: ColorAreaState, i
91
91
let focusedInputRef = useRef < HTMLElement > ( null ) ;
92
92
93
93
let focusInput = useCallback ( ( inputRef = inputXRef ) => {
94
- if ( inputRef ) {
94
+ if ( inputRef . current ) {
95
95
focusWithoutScrolling ( inputRef . current ) ;
96
96
}
97
97
} , [ inputXRef ] ) ;
@@ -112,13 +112,13 @@ export function useColorArea(props: ColorAreaAriaProps, state: ColorAreaState, i
112
112
if ( ! e . shiftKey && / ^ A r r o w (?: R i g h t | L e f t | U p | D o w n ) $ / . test ( e . key ) ) {
113
113
return ;
114
114
}
115
- let stepSize = CHANNEL_STEP_SIZE [ xChannel ] ;
115
+ let stepSize = Math . max ( step , CHANNEL_STEP_SIZE [ xChannel ] ) ;
116
116
let range = stateRef . current . value . getChannelRange ( xChannel ) ;
117
117
switch ( e . key ) {
118
118
case 'PageUp' :
119
119
case 'ArrowUp' :
120
120
range = stateRef . current . value . getChannelRange ( yChannel ) ;
121
- stepSize = CHANNEL_STEP_SIZE [ yChannel ] ;
121
+ stepSize = Math . max ( step , CHANNEL_STEP_SIZE [ yChannel ] ) ;
122
122
stateRef . current . setYValue (
123
123
clamp (
124
124
( Math . floor ( stateRef . current . yValue / stepSize ) + 1 ) * stepSize ,
@@ -131,7 +131,7 @@ export function useColorArea(props: ColorAreaAriaProps, state: ColorAreaState, i
131
131
case 'PageDown' :
132
132
case 'ArrowDown' :
133
133
range = stateRef . current . value . getChannelRange ( yChannel ) ;
134
- stepSize = CHANNEL_STEP_SIZE [ yChannel ] ;
134
+ stepSize = Math . max ( step , CHANNEL_STEP_SIZE [ yChannel ] ) ;
135
135
stateRef . current . setYValue (
136
136
clamp (
137
137
( Math . ceil ( stateRef . current . yValue / stepSize ) - 1 ) * stepSize ,
@@ -527,7 +527,7 @@ export function useColorArea(props: ColorAreaAriaProps, state: ColorAreaState, i
527
527
style : HIDDEN_INPUT_STYLES ,
528
528
title : getValueTitle ( ) ,
529
529
disabled : isDisabled ,
530
- value : ` ${ state . value . getChannelValue ( xChannel ) } ` ,
530
+ value : state . value . getChannelValue ( xChannel ) ,
531
531
tabIndex : 0 ,
532
532
onChange : ( e : ChangeEvent < HTMLInputElement > ) => {
533
533
state . setXValue ( parseFloat ( e . target . value ) ) ;
@@ -552,7 +552,7 @@ export function useColorArea(props: ColorAreaAriaProps, state: ColorAreaState, i
552
552
} ,
553
553
title : getValueTitle ( ) ,
554
554
disabled : isDisabled ,
555
- value : ` ${ state . value . getChannelValue ( yChannel ) } ` ,
555
+ value : state . value . getChannelValue ( yChannel ) ,
556
556
tabIndex : - 1 ,
557
557
onChange : ( e : ChangeEvent < HTMLInputElement > ) => {
558
558
state . setYValue ( parseFloat ( e . target . value ) ) ;
0 commit comments