🐛(react) make datagrid select column visible

Due to a previous commit f398e51db3 the selection
column was invisible, this way caused by having table-layout: fixed and
width: 0 on the select column at the same time.
This commit is contained in:
Nathan Vasse
2024-08-02 15:32:13 +02:00
committed by Jean-Baptiste PENRATH
parent dbd5f05652
commit 1514e4f0b3
4 changed files with 8 additions and 8 deletions

View File

@@ -0,0 +1,5 @@
---
"@openfun/cunningham-react": patch
---
make datagrid select column visible

View File

@@ -84,12 +84,6 @@
tbody {
background-color: var(--c--theme--colors--greyscale-000);
}
.c__datagrid__row__cell--select, .c__datagrid__header--select {
width: 0;
padding-right: 0;
}
}
}

View File

@@ -199,8 +199,8 @@ export const DataGrid = <T extends Row>({
<tr key={headerGroup.id}>
{headerGroup.headers.map((header, i) => {
const style: CSSProperties = {};
const column = columns[i];
if (column && typeof column.size === "number") {
const column = headlessColumns[i];
if (column && typeof column.size !== "undefined") {
style.width = `${column.size}px`;
}

View File

@@ -50,6 +50,7 @@ export const useHeadlessColumns = <T extends Row>({
headlessColumns = [
columnHelper.display({
id: HEADER_ID_SELECT,
size: 34,
header: () => null,
cell: ({ row }) => (
<Checkbox