Skip to content

Commit 96edd8d

Browse files
committed
frontend: Table: Hide rows with hidden columns
This change ensures that when no columns are visible, the table does not render any rows, making the behavior consistent with the "hide all" button. Fixes: #2932 Signed-off-by: Evangelos Skopelitis <[email protected]>
1 parent 92147eb commit 96edd8d

File tree

1 file changed

+10
-8
lines changed
  • frontend/src/components/common/Table

1 file changed

+10
-8
lines changed

frontend/src/components/common/Table/Table.tsx

+10-8
Original file line numberDiff line numberDiff line change
@@ -402,14 +402,16 @@ export default function Table<RowItem extends Record<string, any>>({
402402
</StyledHeadRow>
403403
</TableHead>
404404
<StyledBody>
405-
{rows.map(row => (
406-
<Row
407-
key={row.id}
408-
cells={row.getVisibleCells()}
409-
table={table}
410-
isSelected={row.getIsSelected()}
411-
/>
412-
))}
405+
{headerGroups[0]?.headers?.length === 0
406+
? null
407+
: rows.map(row => (
408+
<Row
409+
key={row.id}
410+
cells={row.getVisibleCells()}
411+
table={table}
412+
isSelected={row.getIsSelected()}
413+
/>
414+
))}
413415
</StyledBody>
414416
</MuiTable>
415417
<MRT_BottomToolbar table={table} />

0 commit comments

Comments
 (0)