Skip to content

Commit

Permalink
Merge tag 'fixing-bugs-with-keys' into develop
Browse files Browse the repository at this point in the history
Bugfix with keys
  • Loading branch information
shannonhochkins committed May 17, 2023
2 parents 5148f96 + 4991713 commit f181956
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions components/molecules/Table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@ class Table extends Component {
};
};

_getColumnData(column, rowData) {
_getColumnData(column, rowData, columnKey) {
const isString = typeof column === 'string';
const cellData = isString
? rowData[column]
: rowData[column.key];
return [
cellData,
column.key,
columnKey,
rowData,
column,
]
Expand Down Expand Up @@ -216,6 +216,7 @@ class Table extends Component {
return (
<React.Fragment key={`row-${rowKey}`}>
<Row
key={`row-${rowKey}`}
className={onRowClick && '-cursor--pointer'}
isInverse={isInverse}
isStriped={isStriped}
Expand Down Expand Up @@ -265,7 +266,7 @@ class Table extends Component {
</Data>)
}
const decorator = column.dataCellDecorator;
const columnData = this._getColumnData(column, rowData);
const columnData = this._getColumnData(column, rowData, columnKey);
return typeof decorator === 'function' ? (
decorator.apply(this, [...columnData])
) : (
Expand Down

0 comments on commit f181956

Please sign in to comment.