Skip to content

Commit 467537e

Browse files
committed
fix: number input field step
1 parent 151b50c commit 467537e

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/components/NumberInput.tsx

+2-8
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,11 @@ export function NumberInput(props: Props) {
1717

1818
const safeSetValue = (value: number) => {
1919
setRawValue(value);
20-
if (
21-
value < props.min ||
22-
value > props.max ||
23-
isNaN(value) ||
24-
!Number.isInteger(value)
25-
) {
20+
if (value < props.min || value > props.max || isNaN(value)) {
2621
return;
2722
}
2823

2924
if (value !== props.value) {
30-
// TODO, revisit this for x scale/y scale slider
31-
// console.log("safe Set", value);
3225
props.setValue(value);
3326
}
3427
};
@@ -59,6 +52,7 @@ export function NumberInput(props: Props) {
5952
class="relative rounded-md focus-within:(ring-2 ring-fore-base ring-offset-2 ring-offset-back-base) bg-back-base hover:bg-fore-base/5"
6053
minValue={props.min}
6154
maxValue={props.max}
55+
step={props.step}
6256
rawValue={focused() ? rawValue() : props.value}
6357
onRawValueChange={safeSetValue}
6458
>

0 commit comments

Comments
 (0)