Fix copy cell content in sql editor (#18677)

This commit is contained in:
Terry Sutton authored and GitHub committed 2023-11-02 16:40:21 -02:30
1 parent 0e8c97b54a
commit 66f8f7400a
1 file changed
+3 -3
@@ -12,9 +12,9 @@ const Results = ({ id, rows }: { id: string; rows: readonly any[] }) => {
const [cellPosition, setCellPosition] = useState<any>(undefined)
function onCopyCell() {
if (columns && cellPosition) {
const { idx, rowIdx } = cellPosition
const colKey = columns[idx].key
if (cellPosition) {
const { rowIdx, column } = cellPosition
const colKey = column.key
const cellValue = rows[rowIdx]?.[colKey] ?? ''
const value = formatClipboardValue(cellValue)
copyToClipboard(value)