From 37d086d49cf4ead0a76ca5863ae652c7460b0cdf Mon Sep 17 00:00:00 2001 From: Kyle Cunningham Date: Tue, 23 Apr 2024 11:03:24 -0500 Subject: [PATCH] Table Panel: Fix images not showing on hover with multiple data links (#86732) * Fix issue * Prettier * codeincarnate/image-table-fix/ lint * Make linter happy by using div with role of button + improve a11y --------- Co-authored-by: jev forsberg Co-authored-by: nmarrs --- .../src/components/Table/ImageCell.tsx | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/packages/grafana-ui/src/components/Table/ImageCell.tsx b/packages/grafana-ui/src/components/Table/ImageCell.tsx index d4a164cebce..6732bb6c54f 100644 --- a/packages/grafana-ui/src/components/Table/ImageCell.tsx +++ b/packages/grafana-ui/src/components/Table/ImageCell.tsx @@ -1,9 +1,6 @@ -import { cx } from '@emotion/css'; import React from 'react'; -import { useStyles2 } from '../../themes'; import { getCellLinks } from '../../utils'; -import { Button, clearLinkButtonStyles } from '../Button'; import { DataLinksContextMenu } from '../DataLinks/DataLinksContextMenu'; import { TableCellProps } from './types'; @@ -16,7 +13,6 @@ export const ImageCell = (props: TableCellProps) => { const displayValue = field.display!(cell.value); const hasLinks = Boolean(getCellLinks(field, row)?.length); - const clearButtonStyle = useStyles2(clearLinkButtonStyles); return (
@@ -27,12 +23,29 @@ export const ImageCell = (props: TableCellProps) => { links={() => getCellLinks(field, row) || []} > {(api) => { - const img = ; + const img = ( + + ); if (api.openMenu) { return ( - +
); } else { return img;