From d5df95946dd9abf1502cb21bfc8682dd98efb1e1 Mon Sep 17 00:00:00 2001 From: Chris Villa Date: Fri, 15 Sep 2023 16:23:06 +0100 Subject: [PATCH] feat: cast number field types to Number --- packages/core/components/InputOrGroup/index.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/core/components/InputOrGroup/index.tsx b/packages/core/components/InputOrGroup/index.tsx index 1c066fc2df..3a490b7d24 100644 --- a/packages/core/components/InputOrGroup/index.tsx +++ b/packages/core/components/InputOrGroup/index.tsx @@ -292,7 +292,13 @@ export const InputOrGroup = ({ type={field.type} name={name} value={value} - onChange={(e) => onChange(e.currentTarget.value)} + onChange={(e) => { + if (field.type === "number") { + onChange(Number(e.currentTarget.value)); + } else { + onChange(e.currentTarget.value); + } + }} readOnly={readOnly} />