diff --git a/src/admin/components/forms/Form/fieldReducer.ts b/src/admin/components/forms/Form/fieldReducer.ts index 0e8f9d79cc..8180a6d4b6 100644 --- a/src/admin/components/forms/Form/fieldReducer.ts +++ b/src/admin/components/forms/Form/fieldReducer.ts @@ -95,8 +95,11 @@ function fieldReducer(state: Fields, action): Fields { }; } - // Add new object containing subfield names to unflattenedRows array - unflattenedRows.splice(rowIndex + 1, 0, subFieldState); + // If there are subfields + if (Object.keys(subFieldState).length > 0) { + // Add new object containing subfield names to unflattenedRows array + unflattenedRows.splice(rowIndex + 1, 0, subFieldState); + } const newState = { ...remainingFlattenedState,