fix(frontend): fix insert new item (#2519)

* fix(frontend): fix insert new item

* fix(frontend): fix insert new item
This commit is contained in:
Faton Ramadani
2023-10-27 18:36:27 +02:00
committed by GitHub
parent fb2da8ebb7
commit e8ee90f39a

View File

@@ -336,6 +336,12 @@ export function insertNewGridItem(
const key = focusedGrid
? `${focusedGrid?.parentComponentId}-${focusedGrid?.subGridIndex ?? 0}`
: undefined
if (key && app.subgrids[key] === undefined) {
// If ever the subgrid is undefined, we want to make sure it is defined
app.subgrids[key] = []
}
let grid = focusedGrid ? app.subgrids[key!] : app.grid
const newItem = createNewGridItem(grid, id, data, columns)
@@ -745,4 +751,3 @@ export function recursivelyFilterKeyInJSON(
})
return filteredJSON
}