Table Component: Improve text-wrapping behavior of cells (#82872)

* Fix text-wrapping of cells in Tables

* Set wordbreak on hover for long texts without spaces
This commit is contained in:
Alvaro Huarte
2024-02-23 06:20:56 +02:00
committed by GitHub
parent 62163f8844
commit 49299ebd9c
@@ -48,7 +48,11 @@ export function useTableStyles(theme: GrafanaTheme2, cellHeightOption: TableCell
'&:hover': {
overflow: overflowOnHover ? 'visible' : undefined,
width: overflowOnHover ? 'auto !important' : undefined,
width: overflowOnHover ? 'auto' : undefined,
height: overflowOnHover ? 'auto' : `${rowHeight - 1}px`,
minHeight: `${rowHeight - 1}px`,
wordBreak: overflowOnHover ? 'break-word' : undefined,
whiteSpace: overflowOnHover ? 'normal' : 'nowrap',
boxShadow: overflowOnHover ? `0 0 2px ${theme.colors.primary.main}` : undefined,
background: overflowOnHover ? background ?? theme.components.table.rowHoverBackground : undefined,
zIndex: overflowOnHover ? 1 : undefined,