From 1be402e3bba6723357ddd37dc0dd079fe931cd23 Mon Sep 17 00:00:00 2001 From: AllenFang Date: Tue, 22 Aug 2017 00:13:40 +0800 Subject: [PATCH] fix #1552 --- src/TableBody.js | 3 ++- src/TableRow.js | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/TableBody.js b/src/TableBody.js index 4ee028cbb..a270370fb 100644 --- a/src/TableBody.js +++ b/src/TableBody.js @@ -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 } diff --git a/src/TableRow.js b/src/TableRow.js index 3e2713b95..4913bd4f1 100644 --- a/src/TableRow.js +++ b/src/TableRow.js @@ -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); @@ -33,7 +35,9 @@ class TableRow extends Component { this.clickNum = 0; }, 200); } else { - this.expandRow(rowIndex, cellIndex); + if (dbClickToEdit) { + this.expandRow(rowIndex, cellIndex); + } } } }