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 cells = container.querySelectorAll('[role="gridcell"]');
const cellStyles = window.getComputedStyle(cells[0]); const cellStyles = window.getComputedStyle(cells[0]);
// In the getStyles function, when textWrap is true, whiteSpace is set to 'break-spaces' // In the getStyles function, when textWrap is true, whiteSpace is set to 'normal'
expect(cellStyles.getPropertyValue('white-space')).toBe('break-spaces'); expect(cellStyles.getPropertyValue('white-space')).toBe('normal');
}); });
}); });

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

Loading…
Cancel
Save