Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit bce8fca

Browse files
committed
update step
1 parent 1bb7639 commit bce8fca

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/common/features/packages-helpers/react-input-slider-wrapper.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ interface Props {
88

99
export function ReactInputSliderWrapper({ value, onChange }: Props) {
1010
const rootRef = useRef<HTMLSpanElement | null>(null);
11+
const step = 0.1;
1112

1213
const handleKeyboard = (e: React.KeyboardEvent) => {
1314
if (e.key === "ArrowLeft" && value > 0) {
14-
onChange(value - 1);
15+
onChange(value - step);
1516
}
1617
if (e.key === "ArrowRight" && value < 100) {
17-
onChange(value + 1);
18+
onChange(value + step);
1819
}
1920
};
2021

@@ -26,7 +27,7 @@ export function ReactInputSliderWrapper({ value, onChange }: Props) {
2627
onKeyUp={handleKeyboard}
2728
onClick={() => rootRef.current?.focus()}
2829
>
29-
<Slider axis="x" xstep={0.1} x={value} onChange={({ x }) => onChange(x)} />
30+
<Slider axis="x" xstep={step} x={value} onChange={({ x }) => onChange(x)} />
3031
</span>
3132
);
3233
}

0 commit comments

Comments
 (0)