From ab1ede5347349d2c206ee7afda23d59ee2cdfe87 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Sun, 27 Jul 2025 23:11:06 +0200 Subject: [PATCH] fix --- .../AggregationPanel/AggregationPanel.js | 17 ++++++++++++++++- src/dashboard/Data/Browser/DataBrowser.react.js | 15 +++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/components/AggregationPanel/AggregationPanel.js b/src/components/AggregationPanel/AggregationPanel.js index 1f572d3345..c85024338f 100644 --- a/src/components/AggregationPanel/AggregationPanel.js +++ b/src/components/AggregationPanel/AggregationPanel.js @@ -190,8 +190,23 @@ const AggregationPanel = ({ ); } + const handleKeyDown = (e) => { + if ((e.ctrlKey || e.metaKey) && e.key === 'c') { + const selection = window.getSelection(); + if (selection && selection.toString().length > 0) { + // Stop the event from propagating to parent handlers + e.stopPropagation(); + // Let the default copy behavior happen by not calling preventDefault + return; + } + } + }; + return ( -
+
{isLoadingInfoPanel ? (
diff --git a/src/dashboard/Data/Browser/DataBrowser.react.js b/src/dashboard/Data/Browser/DataBrowser.react.js index 6b628f6d00..0c1f260f3d 100644 --- a/src/dashboard/Data/Browser/DataBrowser.react.js +++ b/src/dashboard/Data/Browser/DataBrowser.react.js @@ -379,6 +379,21 @@ export default class DataBrowser extends React.Component { return; } if (e.keyCode === 67 && (e.ctrlKey || e.metaKey)) { + // Check for text selection FIRST + const selection = window.getSelection(); + const selectedText = selection ? selection.toString() : ''; + + // If there's text selected, check if we're in the aggregation panel + if (selectedText.length > 0) { + const target = e.target; + const isWithinPanel = this.aggregationPanelRef?.current && this.aggregationPanelRef.current.contains(target); + + if (isWithinPanel) { + // Let the browser handle the copy operation for selected text + return; + } + } + // check if there is multiple selected cells const { rowStart, rowEnd, colStart, colEnd } = this.state.selectedCells; if (rowStart !== -1 && rowEnd !== -1 && colStart !== -1 && colEnd !== -1) {