Skip to content

Commit

Permalink
fix #1552
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed Aug 21, 2017
1 parent fced9fa commit 1be402e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/TableBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ class TableBody extends Component {
onSelectRow={ this.handleSelectRow }
onExpandRow={ this.handleClickCell }
unselectableRow={ disable }
style={ trStyle }>
style={ trStyle }
dbClickToEdit={ cellEdit.mode === Const.CELL_EDIT_DBCLICK } >
{ this.props.expandColumnOptions.expandColumnVisible &&
this.props.expandColumnOptions.expandColumnBeforeSelectColumn &&
expandedRowColumn }
Expand Down
8 changes: 6 additions & 2 deletions src/TableRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ class TableRow extends Component {
const rowIndex = this.props.index + 1;
const cellIndex = e.target.cellIndex;
if (this.props.onRowClick) this.props.onRowClick(rowIndex, cellIndex);
const { selectRow, unselectableRow, isSelected, onSelectRow, onExpandRow } = this.props;
const {
selectRow, unselectableRow, isSelected, onSelectRow, onExpandRow, dbClickToEdit
} = this.props;
if (selectRow) {
if (selectRow.clickToSelect && !unselectableRow) {
onSelectRow(rowIndex, !isSelected, e);
Expand All @@ -33,7 +35,9 @@ class TableRow extends Component {
this.clickNum = 0;
}, 200);
} else {
this.expandRow(rowIndex, cellIndex);
if (dbClickToEdit) {
this.expandRow(rowIndex, cellIndex);
}
}
}
}
Expand Down

0 comments on commit 1be402e

Please sign in to comment.