From 66f8f7400a90011622b5eb3f23efd31a97cd028e Mon Sep 17 00:00:00 2001 From: Terry Sutton Date: Thu, 2 Nov 2023 16:40:21 -0230 Subject: [PATCH] Fix copy cell content in sql editor (#18677) --- .../interfaces/SQLEditor/UtilityPanel/Results.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/studio/components/interfaces/SQLEditor/UtilityPanel/Results.tsx b/studio/components/interfaces/SQLEditor/UtilityPanel/Results.tsx index 2d9ebb396ae..868a51757a1 100644 --- a/studio/components/interfaces/SQLEditor/UtilityPanel/Results.tsx +++ b/studio/components/interfaces/SQLEditor/UtilityPanel/Results.tsx @@ -12,9 +12,9 @@ const Results = ({ id, rows }: { id: string; rows: readonly any[] }) => { const [cellPosition, setCellPosition] = useState(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)