From 06ea490cc2fe4c7bbd0bc6e489b0fe534fcd74de Mon Sep 17 00:00:00 2001 From: Oscar Kilhed Date: Mon, 3 Apr 2023 12:34:29 +0200 Subject: [PATCH] TablePanel: Fix table cells overflowing when there are multiple data links (#65711) * Fix table cells overflowing when there are multiple data links --- .../src/components/Table/DefaultCell.tsx | 14 ++++++++------ packages/grafana-ui/src/components/Table/styles.ts | 1 + 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/grafana-ui/src/components/Table/DefaultCell.tsx b/packages/grafana-ui/src/components/Table/DefaultCell.tsx index 6f5a87988d3..1f55e3cc588 100644 --- a/packages/grafana-ui/src/components/Table/DefaultCell.tsx +++ b/packages/grafana-ui/src/components/Table/DefaultCell.tsx @@ -7,7 +7,7 @@ import { TableCellBackgroundDisplayMode, TableCellOptions } from '@grafana/schem import { useStyles2 } from '../../themes'; import { getCellLinks, getTextColorForAlphaBackground } from '../../utils'; -import { Button, clearLinkButtonStyles } from '../Button'; +import { clearLinkButtonStyles } from '../Button'; import { DataLinksContextMenu } from '../DataLinks/DataLinksContextMenu'; import { CellActions } from './CellActions'; @@ -42,15 +42,17 @@ export const DefaultCell = (props: TableCellProps) => { {hasLinks && ( getCellLinks(field, row) || []}> {(api) => { - const content =
{value}
; if (api.openMenu) { return ( - + ); } else { - return content; + return
{value}
; } }}
diff --git a/packages/grafana-ui/src/components/Table/styles.ts b/packages/grafana-ui/src/components/Table/styles.ts index b8b05bc410f..ee871a2cd22 100644 --- a/packages/grafana-ui/src/components/Table/styles.ts +++ b/packages/grafana-ui/src/components/Table/styles.ts @@ -175,6 +175,7 @@ export function useTableStyles(theme: GrafanaTheme2, cellHeightOption: TableCell font-weight: ${theme.typography.fontWeightMedium}; &:hover { text-decoration: underline; + color: ${theme.colors.text.link}; } `, cellLinkForColoredCell: css`