Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 3ebbf52

Browse files
committed
webui: Avoid whitespace on the last page of the database view page
1 parent 4a8d99d commit 3ebbf52

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

webui/jsx/database-view.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,8 @@ export default function DatabaseView() {
507507
/>
508508
<DatabasePageControls position="top" offset={offset} maxRows={maxRows} rowCount={rowCount} setOffset={(newOffset) => changeView(table, newOffset, sortColumns.length ? sortColumns[0].columnKey : null, sortColumns.length ? sortColumns[0].direction : null)} />
509509
<DataGrid
510-
// The "+ 1" includes the header row. The 35 is the default row height size in pixels.
511-
style={{height: ((maxRows + 1) * 35) + "px", overflow: "hidden"}}
510+
// We are showing one page of rows unless this is the last page with a smaller number of rows. The "+ 1" includes the header row. The 35 is the default row height size in pixels.
511+
style={{height: ((Math.min(rowCount - offset, maxRows) + 1) * 35) + "px", overflow: "hidden"}}
512512
className="rdg-light"
513513
renderers={{noRowsFallback: <DataGridNoRowsRender />}}
514514
columns={columns}

0 commit comments

Comments
 (0)