Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partial selection of text in results grid always copies full text. V8.13 #8150

Closed
Customerology opened this issue Nov 19, 2024 · 3 comments
Closed
Labels

Comments

@Customerology
Copy link

Please note that security bugs or issues should be reported to [email protected].

Describe the bug

If you double-click on a cell in the results grid that contains text or JSON values, you can select a portion of the displayed text. However, clicking ctrl-c always results in the complete value of the cell being copied to the clipboard instead of just the selected/highlighted text. The behavior between JSON edits and text edits is different regarding the context menu. In a text cell, if you right-click on the highlighted text you are presented with a context menu that has cut/copy/paste/etc options available and using cut or copy from the context menu does correctly place the highlighted text in the clipboard. However in a JSON cell the presented window with the JSON content shows the character count of text as it is being selected but when the context menu is displayed the cut and copy options are greyed out. Pressing ctrl-C places the entire JSON in the clipboard. Note: pressing the delete key correctly removes only the highlighted text.

To Reproduce

Steps to reproduce the behavior:

  1. Execute a query that produces columns with regular text and Json(b)
  2. double click on a text or json cell and highlight a portion of the displayed text.
  3. if in a json cell, invoke the context menu (right-click) and observe that cut/copy are not available.
  4. Press ctrl-c.
  5. Go to another window that will accept text and paste the clipboard contents there via ctrl-v etc.
  6. Note that the entire content of the source cell is pasted, not just the highlighted text

Expected behavior

Only the highlighted text should be placed on the clipboard via ctrl-c. Also in the Json edit window the cut/copy options should be enabled in the context menu when text has been highlighted.

Error message

Screenshots

Desktop (please complete the following information):

  • OS: Windows 11 Pro 23H2
  • Version: pgAdmin4 v8.13
  • Mode: Desktop
  • Browser (if running in server mode): [e.g. chrome, safari]
  • Package type: Windows Installer

Additional context

@anilsahoo20
Copy link
Contributor

Hi @Customerology
I can confirm, ctrl+c copying the whole content but not the highlighted or selected content.

But the step-3 you mentioned, My context menu shows cut, copy, paste, select all options, attached screenshot for reference.
Screenshot 2024-11-20 at 10 32 25 AM
Screenshot 2024-11-20 at 10 32 52 AM

@Customerology
Copy link
Author

@anilsahoo20

I am sorry I did not realize there was a difference when using JSON vs JSONB

When trying to reproduce this with JSON columns, after double-clicking the cell, click the button to choose 'Format JSON Data' icon (first icon) then try selecting text and invoking the context menu. In this case the cut and copy options are greyed out. With JSONB columns the 'Format JSON data' is the default view so this problem appears immediately. Regardless of whether it is JSON or JSONB the problem does not appear if 'Compact JSON data' (second icon) is chosen but always appears if 'Format JSON data' is the current view.

image
image

@adityatoshniwal
Copy link
Contributor

Will be taken care in #8157 as both are related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants