Commit a0aaf700 by David Committed by GitHub

Merge pull request #13886 from grafana/davkal/explore-fix-cell-click

Explore: fix copy/paste on table cells
parents b00e709a 5a23723f
...@@ -21,10 +21,16 @@ function prepareRows(rows, columnNames) { ...@@ -21,10 +21,16 @@ function prepareRows(rows, columnNames) {
export default class Table extends PureComponent<TableProps> { export default class Table extends PureComponent<TableProps> {
getCellProps = (state, rowInfo, column) => { getCellProps = (state, rowInfo, column) => {
return { return {
onClick: () => { onClick: (e: React.SyntheticEvent) => {
const columnKey = column.Header; // Only handle click on link, not the cell
const rowValue = rowInfo.row[columnKey]; if (e.target) {
this.props.onClickCell(columnKey, rowValue); const link = e.target as HTMLElement;
if (link.className === 'link') {
const columnKey = column.Header;
const rowValue = rowInfo.row[columnKey];
this.props.onClickCell(columnKey, rowValue);
}
}
}, },
}; };
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment