From ca0ec24c3d92dfde12e34d38a5b9a074ac268a74 Mon Sep 17 00:00:00 2001 From: Guillermo Garcia Castillo Date: Fri, 15 Sep 2017 15:41:06 +0200 Subject: [PATCH] fix(1463): Added loop to look for the upper td in TableRow.rowClick --- src/TableRow.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/TableRow.js b/src/TableRow.js index 4913bd4f1..d04c3eb73 100644 --- a/src/TableRow.js +++ b/src/TableRow.js @@ -13,7 +13,11 @@ class TableRow extends Component { rowClick = e => { const rowIndex = this.props.index + 1; - const cellIndex = e.target.cellIndex; + let cell = e.target; + while (cell.nodeName !== 'TD' && cell.parentNode) { + cell = cell.parentNode; + } + const cellIndex = cell.cellIndex; if (this.props.onRowClick) this.props.onRowClick(rowIndex, cellIndex); const { selectRow, unselectableRow, isSelected, onSelectRow, onExpandRow, dbClickToEdit