ROWY-791 fix virtualization not handling minimum width correctly

This commit is contained in:
Sidney Alcantara
2022-11-28 18:31:14 +11:00
parent 1f28a8cb5b
commit ca72c656d6

View File

@@ -68,11 +68,11 @@ export function useVirtualization(
const columnDef = leafColumns[index].columnDef;
const schemaWidth = columnDef.size;
const localWidth = columnSizing[columnDef.id || ""];
const definedWidth = localWidth || schemaWidth;
return Math.max(
MIN_COL_WIDTH,
localWidth || schemaWidth || DEFAULT_COL_WIDTH
);
if (definedWidth === undefined) return DEFAULT_COL_WIDTH;
if (definedWidth < MIN_COL_WIDTH) return MIN_COL_WIDTH;
return definedWidth;
},
[leafColumns, columnSizing]
),