Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

Commit

Permalink
fix(tablevis): update datatable change
Browse files Browse the repository at this point in the history
  • Loading branch information
Conglei Shi committed Aug 13, 2019
1 parent 17ce1d9 commit 9846de5
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export const getRenderer = ({
isSelected: (cell: Cell) => boolean;
handleCellSelected: (cell: Cell) => any;
}) => (props: RendererProps) => {
const { key } = props;
const value = props.row.rowData.data[key];
const { keyName } = props;
const value = props.row.rowData.data[keyName];
const isMetric = column.type === 'metric';
let Parent;

Expand All @@ -68,7 +68,8 @@ export const getRenderer = ({
const color = colorPositiveNegative && value < 0 ? NEGATIVE_COLOR : POSITIVE_COLOR;
Parent = ({ children }: { children: React.ReactNode }) => {
const boxStyle: CSSProperties = {
backgroundColor: enableFilter && isSelected({ key, value }) ? SELECTION_COLOR : undefined,
backgroundColor:
enableFilter && isSelected({ key: keyName, value }) ? SELECTION_COLOR : undefined,
margin: '0px -16px',
};
const boxContainerStyle: CSSProperties = {
Expand Down Expand Up @@ -105,7 +106,7 @@ export const getRenderer = ({
return (
<div
onClick={handleCellSelected({
key,
key: keyName,
value,
})}
>
Expand Down

0 comments on commit 9846de5

Please sign in to comment.