Skip to content

Commit

Permalink
<- table -> 1.4.7-beta.2 onclick error
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-long-1988 committed Mar 7, 2019
1 parent ba29a96 commit fc86609
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fast-table",
"version": "1.4.7-beta.1",
"version": "1.4.7-beta.2",
"description": "react table fast",
"main": "./lib/index.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion src/BaseTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class BaseTable extends React.PureComponent<Props> {
getRowData = (event) => {
const key = event.currentTarget.getAttribute('data-key');
const {dataManager} = this.context.manager;
return dataManager.getByKey(key);
return dataManager.getByKey(key) || {};
};

fEvents = (event) => {
Expand Down
8 changes: 4 additions & 4 deletions src/managers/DataManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,13 @@ export default class DataManager {
_rowKey = (record, index) => {
const rowKey = this.rowKey;
if (typeof rowKey === 'function') {
return rowKey(record, index);
return String(rowKey(record, index));
} else if (typeof rowKey === 'string') {
return record[rowKey];
return String(record[rowKey]);
} else if (record['key']) {
return record['key'];
return String(record['key']);
}
return index;
return String(index);
};

_rowClassName = (record, index, level) => {
Expand Down

0 comments on commit fc86609

Please sign in to comment.