mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
fix(app): Make sure empty tables don't have select all rows checkbox checked (#489)
This commit is contained in:
parent
b57855f20d
commit
28b222fffa
2 changed files with 5 additions and 1 deletions
|
@ -3,7 +3,8 @@ import { ColumnDef, Row, Table } from '@tanstack/react-table';
|
|||
import { Checkbox } from '@@/form-components/Checkbox';
|
||||
|
||||
function allRowsSelected<T>(table: Table<T>) {
|
||||
return table.getCoreRowModel().rows.every((row) => row.getIsSelected());
|
||||
const { rows } = table.getCoreRowModel();
|
||||
return rows.length > 0 && rows.every((row) => row.getIsSelected());
|
||||
}
|
||||
|
||||
function someRowsSelected<T>(table: Table<T>) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue