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

Explore: fix copy/paste on table cells
pull/13901/head
David 7 years ago committed by GitHub
commit a0aaf70060
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      public/app/features/explore/Table.tsx

@ -21,10 +21,16 @@ function prepareRows(rows, columnNames) {
export default class Table extends PureComponent<TableProps> {
getCellProps = (state, rowInfo, column) => {
return {
onClick: () => {
const columnKey = column.Header;
const rowValue = rowInfo.row[columnKey];
this.props.onClickCell(columnKey, rowValue);
onClick: (e: React.SyntheticEvent) => {
// Only handle click on link, not the cell
if (e.target) {
const link = e.target as HTMLElement;
if (link.className === 'link') {
const columnKey = column.Header;
const rowValue = rowInfo.row[columnKey];
this.props.onClickCell(columnKey, rowValue);
}
}
},
};
};

Loading…
Cancel
Save