pull/102445/head
Leon Sorokin 3 months ago
parent 7a82af8de1
commit c72530350e
  1. 4
      packages/grafana-ui/src/components/Table/TableNG/TableNG.test.tsx
  2. 4
      packages/grafana-ui/src/components/Table/TableNG/TableNG.tsx

@ -1179,8 +1179,8 @@ describe('TableNG', () => {
const cells = container.querySelectorAll('[role="gridcell"]');
const cellStyles = window.getComputedStyle(cells[0]);
// In the getStyles function, when textWrap is true, whiteSpace is set to 'break-spaces'
expect(cellStyles.getPropertyValue('white-space')).toBe('break-spaces');
// In the getStyles function, when textWrap is true, whiteSpace is set to 'normal'
expect(cellStyles.getPropertyValue('white-space')).toBe('normal');
});
});

@ -476,7 +476,7 @@ export function TableNG(props: TableNGProps) {
avgCharWidth,
defaultLineHeight,
defaultRowHeight,
TABLE.CELL_PADDING * 2,
TABLE.CELL_PADDING,
fieldsData
);
},
@ -950,7 +950,7 @@ const getStyles = (theme: GrafanaTheme2, textWrap: boolean) => ({
cell: css({
'--rdg-border-color': theme.colors.border.medium,
borderLeft: 'none',
whiteSpace: `${textWrap ? 'break-spaces' : 'nowrap'}`,
whiteSpace: `${textWrap ? 'normal' : 'nowrap'}`,
wordWrap: 'break-word',
overflow: 'hidden',
textOverflow: 'ellipsis',

Loading…
Cancel
Save