From b20e2980be6df6d57f9dfb6987b512686ccc5a7a Mon Sep 17 00:00:00 2001 From: Chris Villa Date: Mon, 18 Sep 2023 11:37:17 +0100 Subject: [PATCH] fix: don't switch between controlled/uncontrolled inputs --- packages/core/components/InputOrGroup/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/components/InputOrGroup/index.tsx b/packages/core/components/InputOrGroup/index.tsx index 3a490b7d24..cd20bc9c20 100644 --- a/packages/core/components/InputOrGroup/index.tsx +++ b/packages/core/components/InputOrGroup/index.tsx @@ -199,7 +199,7 @@ export const InputOrGroup = ({ className={getClassName("input")} autoComplete="off" name={name} - value={value} + value={typeof value === "undefined" ? "" : value} onChange={(e) => onChange(e.currentTarget.value)} readOnly={readOnly} rows={5} @@ -291,7 +291,7 @@ export const InputOrGroup = ({ autoComplete="off" type={field.type} name={name} - value={value} + value={typeof value === "undefined" ? "" : value} onChange={(e) => { if (field.type === "number") { onChange(Number(e.currentTarget.value));