mirror of https://github.com/buster-so/buster.git
Update BusterResizeableGrid.tsx
This commit is contained in:
parent
b1a026bd2b
commit
0973733b46
|
@ -381,9 +381,10 @@ const checkRowEquality = (
|
||||||
const newRowPreflight = (newRows: BusterResizeableGridRow[]) => {
|
const newRowPreflight = (newRows: BusterResizeableGridRow[]) => {
|
||||||
let newRowsCopy = removeEmptyContainers([...newRows]);
|
let newRowsCopy = removeEmptyContainers([...newRows]);
|
||||||
|
|
||||||
newRowsCopy = newRowsCopy.map((row) => {
|
newRowsCopy = newRowsCopy.map((row, index) => {
|
||||||
const numberOfColumns = row.columnSizes?.length || 0;
|
const numberOfColumns = row.columnSizes?.length || 0;
|
||||||
const numberOfItems = row.items.length;
|
const numberOfItems = row.items.length;
|
||||||
|
row.id = `${index + 1}`; //we use this instead of uuid because the api likes it better this way
|
||||||
if (
|
if (
|
||||||
numberOfItems !== numberOfColumns ||
|
numberOfItems !== numberOfColumns ||
|
||||||
row.columnSizes?.reduce((a, b) => a + b, 0) !== NUMBER_OF_COLUMNS
|
row.columnSizes?.reduce((a, b) => a + b, 0) !== NUMBER_OF_COLUMNS
|
||||||
|
|
Loading…
Reference in New Issue