[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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -814,9 +814,9 @@ export function InvenTreeTableInternal<T extends Record<string, any>>({
}, [tableProps.onCellClick, tableProps.onRowClick, tableProps.modelType]);
// 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 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`;
}, [tableState.records]);