Skip to content

Commit 06bd74d

Browse files
committed
fix(#2664): useColorSliderState remove ternary statement from decrement
snapValueToStep always starts from minValue.
1 parent d9fbb44 commit 06bd74d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/@react-stately/color/src/useColorSliderState.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export function useColorSliderState(props: ColorSliderStateOptions): ColorSlider
6969
let {maxValue, minValue, step} = color.getChannelRange(channel);
7070
let channelValue = color.getChannelValue(channel);
7171
let s = Math.max(stepSize, step);
72-
sliderState.setThumbValue(index, channelValue - s < minValue ? minValue : snapValueToStep(channelValue - s, minValue, maxValue, s));
72+
sliderState.setThumbValue(index, snapValueToStep(channelValue - s, minValue, maxValue, s));
7373
}
7474

7575
return {

0 commit comments

Comments
 (0)