fix: #338, array / block fields with only nested array block fields break admin UI

This commit is contained in:
James
2021-10-19 10:31:59 -04:00
parent 6d50afd864
commit 86e88d998f

View File

@@ -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,