Skip to content

Commit

Permalink
Merge cell style (#256)
Browse files Browse the repository at this point in the history
In addition to calculating absolute position for cells,
we must also merge in style properties that are attached
to the Cell component itself.
  • Loading branch information
themadcreator authored Nov 28, 2016
1 parent 9ae2871 commit 85240d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/table/src/tableBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class TableBody extends React.Component<ITableBodyProps, {}> {
[CELL_LEDGER_EVEN_CLASS]: (rowIndex % 2) === 0,
});
const key = TableBody.cellReactKey(rowIndex, columnIndex);
const style = Rect.style(grid.getGhostCellRect(rowIndex, columnIndex));
const style = Object.assign({}, cell.props.style, Rect.style(grid.getGhostCellRect(rowIndex, columnIndex)));
return React.cloneElement(cell, { key, style } as ICellProps);
}

Expand All @@ -151,7 +151,7 @@ export class TableBody extends React.Component<ITableBodyProps, {}> {
[CELL_LEDGER_EVEN_CLASS]: (rowIndex % 2) === 0,
});
const key = TableBody.cellReactKey(rowIndex, columnIndex);
const style = Rect.style(grid.getCellRect(rowIndex, columnIndex));
const style = Object.assign({}, cell.props.style, Rect.style(grid.getCellRect(rowIndex, columnIndex)));
return (
<DragSelectable
allowMultipleSelection={allowMultipleSelection}
Expand Down

1 comment on commit 85240d4

@blueprint-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge cell style (#256)

Preview: docs Coverage: core | datetime

Please sign in to comment.