chore: ensures when array / block rows are added, new row count is properly calculated

This commit is contained in:
James
2022-11-05 12:05:34 -04:00
parent f883e04ee1
commit 93acea9d7f

View File

@@ -110,6 +110,7 @@ function fieldReducer(state: Fields, action: FieldAction): Fields {
...remainingFlattenedState,
[path]: {
...(state[path] || {}),
value: unflattenedRows.length,
disableFormData: true,
},
...(flatten({ [path]: unflattenedRows }, { filters: flattenFilters })),
@@ -138,6 +139,7 @@ function fieldReducer(state: Fields, action: FieldAction): Fields {
...remainingFlattenedState,
[path]: {
...(state[path] || {}),
value: unflattenedRows.length,
disableFormData: true,
},
...(flatten({ [path]: unflattenedRows }, { filters: flattenFilters })),