2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-05-28 03:49:20 +00:00

[UI] Adjust table auto height (#12016)

* [UI] Adjust table auto height

- Better height selection
- Tested against more edge cases

* Fix comment
This commit is contained in:
Oliver
2026-05-27 18:50:52 +10:00
committed by GitHub
parent 00ad041e1b
commit 19182bacd0
+2 -2
View File
@@ -814,9 +814,9 @@ export function InvenTreeTableInternal<T extends Record<string, any>>({
}, [tableProps.onCellClick, tableProps.onRowClick, tableProps.modelType]); }, [tableProps.onCellClick, tableProps.onRowClick, tableProps.modelType]);
// When sticky headers are enabled, we adjust the maximum viewport height, // When sticky headers are enabled, we adjust the maximum viewport height,
// based on the number of records being displayed (up to a maximum of 60vh) // based on the number of records being displayed (up to a maximum of 80vh)
const autoHeight = useMemo(() => { const autoHeight = useMemo(() => {
const rows = Math.max(10, Math.min(tableState.records.length, 60)); const rows = Math.min(80, 6 * Math.max(tableState.records.length, 3));
return `${rows}vh`; return `${rows}vh`;
}, [tableState.records]); }, [tableState.records]);