diff --git a/desktop/app/src/ui/components/table/ManagedTable.tsx b/desktop/app/src/ui/components/table/ManagedTable.tsx index 7a90223a9..2b8a07570 100644 --- a/desktop/app/src/ui/components/table/ManagedTable.tsx +++ b/desktop/app/src/ui/components/table/ManagedTable.tsx @@ -575,9 +575,10 @@ export class ManagedTable extends React.Component< } return this.props.rows .filter((row) => highlightedRows.has(row.key)) - .map( - (row: TableBodyRow) => - row.copyText || this.getTextContentOfRow(row.key).join('\t'), + .map((row: TableBodyRow) => + typeof row.copyText === 'function' + ? row.copyText() + : row.copyText || this.getTextContentOfRow(row.key).join('\t'), ) .join('\n'); }; diff --git a/desktop/app/src/ui/components/table/ManagedTable_immutable.tsx b/desktop/app/src/ui/components/table/ManagedTable_immutable.tsx index 1aecdfc3b..8507b9c37 100644 --- a/desktop/app/src/ui/components/table/ManagedTable_immutable.tsx +++ b/desktop/app/src/ui/components/table/ManagedTable_immutable.tsx @@ -551,9 +551,10 @@ class ManagedTable extends React.Component< } return this.props.rows .filter((row) => highlightedRows.has(row.key)) - .map( - (row: TableBodyRow) => - row.copyText || this.getTextContentOfRow(row.key).join('\t'), + .map((row: TableBodyRow) => + typeof row.copyText === 'function' + ? row.copyText() + : row.copyText || this.getTextContentOfRow(row.key).join('\t'), ) .join('\n'); }; diff --git a/desktop/app/src/ui/components/table/types.tsx b/desktop/app/src/ui/components/table/types.tsx index 904cdc5fd..d447d30cb 100644 --- a/desktop/app/src/ui/components/table/types.tsx +++ b/desktop/app/src/ui/components/table/types.tsx @@ -54,7 +54,7 @@ export type TableBodyRow = { type?: string | undefined; highlightedBackgroundColor?: BackgroundColorProperty | undefined; onDoubleClick?: (e: React.MouseEvent) => void; - copyText?: string; + copyText?: string | (() => string); requestBody?: string | null | undefined; responseBody?: string | null | undefined; highlightOnHover?: boolean;