pgadmin-org / pgadmin4

pgAdmin is the most popular and feature rich Open Source administration and development platform for PostgreSQL, the most advanced Open Source database in the world.
https://www.pgadmin.org
Other
2.41k stars 632 forks source link

Ctrl+C to copy does not work in data grid #7920

Open thewildman opened 5 days ago

thewildman commented 5 days ago

Describe the bug

Copying data from the datagrid in the Query Tool does not work in the latest release. Clicking on the "copy" button in the toolbar works fine though.

To Reproduce

Steps to reproduce the behavior:

  1. Run a query
  2. Select all lines by clicking the top left box in the result pane.
  3. Hit ctrl+c
  4. Try to paste anywhere

Expected behavior

Should paste the data

Error message

Pastes what was previously in the clipboard.

Desktop (please complete the following information):

tsardaryanCamenAI commented 5 days ago

Instead of the 2nd step, you could just try to copy any cell value by just selecting it (not double-click) and then use keyboard shortcut to copy the value (Ctrl+C). This bug exists since the last version (8.11), in the previous version it works fine.

augustomen commented 1 day ago

I'll add some extra information here: this only happens when there is selected text in the query editor. In that case, it's the selected text that's copied, regardless of focus. When clearing the selection, the selection from the data grid is copied correctly. Double-clicking the cell to copy the value works, however, sometimes you want to copy multiple rows or columns at once.

thewildman commented 1 day ago

Instead of the 2nd step, you could just try to copy any cell value by just selecting it (not double-click) and then use keyboard shortcut to copy the value (Ctrl+C). This bug exists since the last version (8.11), in the previous version it works fine.

But what f I want to copy the entire data grid ?

I'll add some extra information here: this only happens when there is selected text in the query editor. In that case, it's the selected text that's copied, regardless of focus. When clearing the selection, the selection from the data grid is copied correctly. Double-clicking the cell to copy the value works, however, sometimes you want to copy multiple rows or columns at once.

Possibly, yes. I can't reproduce this in a systematic manner. I thought you were right because most of the time when this happens I paste some SQL instead of values, but right now I'm unable to reproduce it.

adityatoshniwal commented 1 day ago

It looks like an issue with the CodeMirror editor. I have raised the issue here - https://discuss.codemirror.net/t/codemirror-copies-text-even-if-blurred/8627

adityatoshniwal commented 9 minutes ago

Tried to create a minimal reproducible example - https://stackblitz.com/edit/vitejs-vite-wudzeh. Looks like an issue with pgAdmin.