From 86bbecef8e4eeff41ca2a8898beacdb17a0010ea Mon Sep 17 00:00:00 2001 From: Kyle Fang Date: Sun, 21 Nov 2021 21:51:07 +0800 Subject: [PATCH] fix: use default value for when specified new entity id --- src/form/EntityForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/form/EntityForm.tsx b/src/form/EntityForm.tsx index 429898c..ec73285 100644 --- a/src/form/EntityForm.tsx +++ b/src/form/EntityForm.tsx @@ -150,7 +150,7 @@ export function EntityForm({ */ let baseDataSourceValues: Partial>; if ((status === "existing" || status === "copy") && entity) { - baseDataSourceValues = entity.values ?? {}; + baseDataSourceValues = entity.values ?? initEntityValues(schema, path); } else if (status === "new") { baseDataSourceValues = initEntityValues(schema, path); } else {