From 7fb29463619a26ae11f2f554bda39e42c6a8c069 Mon Sep 17 00:00:00 2001 From: Sacha Weatherstone Date: Mon, 15 Jan 2024 10:31:52 +1000 Subject: [PATCH] allow decimals in form inputs --- src/components/Form/FormInput.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/Form/FormInput.tsx b/src/components/Form/FormInput.tsx index bd61a3f2..af69d882 100644 --- a/src/components/Form/FormInput.tsx +++ b/src/components/Form/FormInput.tsx @@ -11,6 +11,7 @@ export interface InputFieldProps extends BaseFormBuilderProps { properties?: { prefix?: string; suffix?: string; + step?: number; action?: { icon: LucideIcon; onClick: () => void; @@ -30,11 +31,12 @@ export function GenericInput({ render={({ field: { value, onChange, ...rest } }) => ( onChange( field.type === "number" - ? parseInt(e.target.value) + ? Number.parseInt(e.target.value) : e.target.value, ) }