From 95280e686409342d3be3d68ec2acb90f7cfc570e Mon Sep 17 00:00:00 2001 From: Chris Villa Date: Mon, 25 Mar 2024 20:30:38 +0100 Subject: [PATCH] fix: fix array field when used on root --- .../core/components/InputOrGroup/fields/ArrayField/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/core/components/InputOrGroup/fields/ArrayField/index.tsx b/packages/core/components/InputOrGroup/fields/ArrayField/index.tsx index 9cd8f58bc1..b529c0cab5 100644 --- a/packages/core/components/InputOrGroup/fields/ArrayField/index.tsx +++ b/packages/core/components/InputOrGroup/fields/ArrayField/index.tsx @@ -95,7 +95,9 @@ export const ArrayField = ({ // Create a mirror of value with IDs added for drag and drop useEffect(() => { - setUi(mapArrayStateToUi(arrayState)); + if (arrayState.items.length > 0) { + setUi(mapArrayStateToUi(arrayState)); + } }, []); const [hovering, setHovering] = useState(false);