Skip to content

Commit

Permalink
Fix addPlacholderRows with cell styles defined
Browse files Browse the repository at this point in the history
  • Loading branch information
techniq committed Jun 21, 2019
1 parent 303b8ac commit 2d2bb87
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,13 +349,18 @@ function MuiTable(props) {
})
);

cellProps.style = {
...cellProps.style,
visibility: 'hidden'
};

return (
<TableCell
style={{ visibility: 'hidden' }}
key={`body-cell-placeholder-${rowIndex}-${column.name}`}
{...cellProps}
>
' '
&nbsp;
</TableCell>
);
})}
Expand Down
25 changes: 25 additions & 0 deletions stories/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,31 @@ storiesOf('Pagination', module)
/>
);
})
.add('addPlaceholderRows with cell styles', () => {
const data = createPersonData(13);
return (
<PaginatedTable
data={data}
columns={[
{
name: 'fullName',
header: 'Name',
cell: d => `${d.firstName} ${d.lastName}`
},
{ name: 'jobTitle', header: 'Job Title' },
{ name: 'jobArea', header: 'Job Area' }
]}
addPlaceholderRows
includeHeaders
cellProps={{
style: {
padding: 4
}
}}
containerProps={{ style: { backgroundColor: 'white' } }}
/>
);
})
.add('addPlaceholderRows and empty data', () => {
return (
<PaginatedTable
Expand Down

0 comments on commit 2d2bb87

Please sign in to comment.