Table: Fix justifyContent with cellLink overflow (#90353)

* Table: Fix justifyContent with cellLink overflow

* Add textAlign to fix failing test
This commit is contained in:
Drew Slobodnjak 2024-07-16 09:26:06 -07:00 committed by GitHub
parent 4ef6ff7c44
commit 4de34ac246
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -41,7 +41,14 @@ export const TableCell = ({
if (cellProps.style) {
cellProps.style.minWidth = cellProps.style.width;
cellProps.style.justifyContent = (cell.column as any).justifyContent;
const justifyContent = (cell.column as any).justifyContent;
if (justifyContent === 'flex-end') {
// justify-content flex-end is not compatible with cellLink overflow; use direction instead
cellProps.style.textAlign = 'right';
cellProps.style.direction = 'rtl';
} else {
cellProps.style.justifyContent = justifyContent;
}
}
let innerWidth = (typeof cell.column.width === 'number' ? cell.column.width : 24) - tableStyles.cellPadding * 2;