From 4de34ac246226d02a3ea90272b12ed291fdf3342 Mon Sep 17 00:00:00 2001 From: Drew Slobodnjak <60050885+drew08t@users.noreply.github.com> Date: Tue, 16 Jul 2024 09:26:06 -0700 Subject: [PATCH] Table: Fix justifyContent with cellLink overflow (#90353) * Table: Fix justifyContent with cellLink overflow * Add textAlign to fix failing test --- packages/grafana-ui/src/components/Table/TableCell.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/grafana-ui/src/components/Table/TableCell.tsx b/packages/grafana-ui/src/components/Table/TableCell.tsx index 56649902761..44f616e4642 100644 --- a/packages/grafana-ui/src/components/Table/TableCell.tsx +++ b/packages/grafana-ui/src/components/Table/TableCell.tsx @@ -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;