Skip to content

Commit 78a56fd

Browse files
committed
No longer rendering empty buttons for missing values in table actions
1 parent b6b36f2 commit 78a56fd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/chart/table/TableChart.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,17 @@ const fallbackRenderer = (value) => {
4040

4141
function renderAsButtonWrapper(renderer) {
4242
return function renderAsButton(value) {
43+
const outputValue = renderer(value, true);
44+
// If there's nothing to be rendered, there's no button needed.
45+
if (outputValue == '') {
46+
return <></>;
47+
}
4348
return (
4449
<Button
4550
style={{ width: '100%', marginLeft: '5px', marginRight: '5px' }}
4651
variant='contained'
4752
color='primary'
48-
>{`${renderer(value, true)}`}</Button>
53+
>{`${outputValue}`}</Button>
4954
);
5055
};
5156
}

0 commit comments

Comments
 (0)