From b5ffae1fb64ed6aaf854afe1155a0b095365403b Mon Sep 17 00:00:00 2001 From: Du Peng Date: Mon, 19 Sep 2022 19:08:52 +0200 Subject: [PATCH] (bug) form input cannot save a float --- app/frontend/src/javascript/components/form/form-input.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/frontend/src/javascript/components/form/form-input.tsx b/app/frontend/src/javascript/components/form/form-input.tsx index 31b04bec1..78f15d801 100644 --- a/app/frontend/src/javascript/components/form/form-input.tsx +++ b/app/frontend/src/javascript/components/form/form-input.tsx @@ -59,7 +59,7 @@ export const FormInput = ({ id, re {...register(id as FieldPath, { ...rules, valueAsDate: type === 'date', - setValueAs: v => (v === null && nullable) ? null : (type === 'number' ? parseInt(v, 10) : v), + setValueAs: v => (v === null && nullable) ? null : (type === 'number' ? parseFloat(v) : v), value: defaultValue as FieldPathValue>, onChange: (e) => { handleChange(e); } })}