Update BusterResizeableGrid.tsx

This commit is contained in:
Nate Kelley 2025-04-18 22:55:15 -06:00
parent b1a026bd2b
commit 0973733b46
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
1 changed files with 2 additions and 1 deletions

View File

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