Skip to content

Commit

Permalink
prevent extra div if not truncating
Browse files Browse the repository at this point in the history
  • Loading branch information
stevetracvc committed May 25, 2022
1 parent 10fa3bb commit 4a236a8
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -412,20 +412,20 @@ export default function TableChart<D extends DataRecord = DataRecord>(
].join(' '),
};
if (html) {
if (truncateLongCells) {
// eslint-disable-next-line react/no-danger
return (
<StyledCell {...cellProps}>
<div
className="dt-truncate-cell"
style={columnWidth ? { width: columnWidth } : undefined}
dangerouslySetInnerHTML={html}
/>
</StyledCell>
);
}
// eslint-disable-next-line react/no-danger
return (
<StyledCell {...cellProps}>
<div
{...(truncateLongCells
? {
className: 'dt-truncate-cell',
style: columnWidth ? { width: columnWidth } : undefined,
}
: undefined)}
dangerouslySetInnerHTML={html}
/>
</StyledCell>
);
return <StyledCell {...cellProps} dangerouslySetInnerHTML={html} />;
}
// If cellProps renderes textContent already, then we don't have to
// render `Cell`. This saves some time for large tables.
Expand Down

0 comments on commit 4a236a8

Please sign in to comment.