Skip to content

Commit

Permalink
Fixed an issue where doing Ctrl/Cmd+C on a selected text in a cell ed…
Browse files Browse the repository at this point in the history
…itor of data output in the query tool copied the complete text. #8157
  • Loading branch information
adityatoshniwal committed Dec 4, 2024
1 parent c2dcfdb commit 256d1e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
2 changes: 2 additions & 0 deletions docs/en_US/release_notes_8_14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ New features
| `Issue #3751 <https://github.com/pgadmin-org/pgadmin4/issues/3751>`_ - Show auto-complete column names in filtered rows dialog of table and filter options of view/edit data tool.
| `Issue #5786 <https://github.com/pgadmin-org/pgadmin4/issues/5786>`_ - Allow the use of a pgpass file in the pgAdmin container via Docker secrets.
| `Issue #6592 <https://github.com/pgadmin-org/pgadmin4/issues/6592>`_ - Fixed multiple issues and improved ERD auto-layout.
| `Issue #6794 <https://github.com/pgadmin-org/pgadmin4/issues/6794>`_ - Add support for passing connection details as placeholders in the passexec command.
| `Issue #7330 <https://github.com/pgadmin-org/pgadmin4/issues/7330>`_ - Add support to deploy pgAdmin in a container with readOnlyRootFilesystem to true.
| `Issue #8095 <https://github.com/pgadmin-org/pgadmin4/issues/8095>`_ - Added support for a builtin locale provider in the Database dialog.
Expand All @@ -44,4 +45,5 @@ Bug fixes
| `Issue #8098 <https://github.com/pgadmin-org/pgadmin4/issues/8098>`_ - Fixed an issue in schema diff where an error message popup was showing some garbage without any info.
| `Issue #8127 <https://github.com/pgadmin-org/pgadmin4/issues/8127>`_ - Fixed an issue where query tool should not prompt for unsaved changes when there are no changes.
| `Issue #8134 <https://github.com/pgadmin-org/pgadmin4/issues/8134>`_ - Add a user preference to enable/disable alternating row background colors in the data output of query tool.
| `Issue #8157 <https://github.com/pgadmin-org/pgadmin4/issues/8157>`_ - Fixed an issue where doing Ctrl/Cmd+C on a selected text in a cell editor of data output in the query tool copied the complete text.
| `Issue #8158 <https://github.com/pgadmin-org/pgadmin4/issues/8158>`_ - Fixed an issue where auto-width of wide columns in data output is incorrectly calculated.
Original file line number Diff line number Diff line change
Expand Up @@ -274,15 +274,8 @@ function initialiseColumns(columns, rows, totalRowCount, columnWidthBy) {
for(const col of retColumns) {
col.width = getColumnWidth(col, rows, canvasContext, columnWidthBy);
col.resizable = true;
col.renderEditCellOptions = {
col.editorOptions = {
commitOnOutsideClick: false,
onCellKeyDown: (e)=>{
// global keyboard shortcuts will work now and will open the the editor for the cell once pgAdmin reopens
if(!e.metaKey && !e.altKey && !e.shiftKey && !e.ctrlKey){
/* Do not open the editor */
e.preventDefault();
}
}
};
setEditorFormatter(col);
}
Expand Down Expand Up @@ -393,12 +386,6 @@ export default function QueryToolDataGrid({columns, rows, totalRowCount, dataCha
}

function handleShortcuts(e) {
// Handle Copy shortcut Cmd/Ctrl + c
if((e.ctrlKey || e.metaKey) && e.key !== 'Control' && e.keyCode == 67) {
e.preventDefault();
handleCopy();
}

// Handle Select All Cmd + A(mac) / Ctrl + a (others)
if(((isMac() && e.metaKey) || (!isMac() && e.ctrlKey)) && e.key === 'a') {
e.preventDefault();
Expand Down

0 comments on commit 256d1e5

Please sign in to comment.