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
pull/83286/head
Alvaro Huarte 1 year ago committed by GitHub
parent 62163f8844
commit 49299ebd9c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      packages/grafana-ui/src/components/Table/styles.ts

@ -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,

Loading…
Cancel
Save