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

Copying to clipboard does not work for disabled code interface #11684

Closed
3 tasks done
HerrBlauwasser opened this issue Feb 17, 2022 · 5 comments · Fixed by #11769
Closed
3 tasks done

Copying to clipboard does not work for disabled code interface #11684

HerrBlauwasser opened this issue Feb 17, 2022 · 5 comments · Fixed by #11769

Comments

@HerrBlauwasser
Copy link

Preflight Checklist

Describe the Bug

When trying to select text from a text field which is disabled, the text is not copied to the clipboard.

To Reproduce

Open a collection entry for that you don't have writing permissions. Select some text from a field and press CTRL-c. Paste your clipboard to another window.

Same for any text field when opening an old revision of a collection entry.

Errors Shown

No response

What version of Directus are you using?

9.5.1

What version of Node.js are you using?

17.3.1

What database are you using?

PostgreSQL 13.5

What browser are you using?

Firefox, Chrome

What operating system are you using?

Linux, Windows

How are you deploying Directus?

npx

@licitdev
Copy link
Member

Hi @DL1PZ, I am unable to reproduce it based on the information provided.

May I ask which field are you selecting text from? I have created a text input field with only read permissions, and I am able to copy the value by selecting the text.

Alternatively, you may copy the raw value via the following method:

Screen.Recording.2022-02-20.at.10.19.42.PM.mov

Please kindly provide a screen recording or detailed steps to reproduce the issue.
Thank you.

@HerrBlauwasser
Copy link
Author

Thank you very much for trying to reproduce the issue.

The issue does not affect fields which are set readonly. As explained in my initial post, it affects fields for that the current user does not have write permissions as well as fields in the revision history view. I hope that helps. If not, I can provide a screen recording.

The hint to access the raw value helps a lot as a workaround.

Nevertheless, the problem should be solved to provide the expected behavior when selecting text.

@licitdev
Copy link
Member

@DL1PZ Please provide screenshots or a screen recording. Thank you.

On a side note, I wonder if it is an issue with Ctrl+C as I am testing this on MacOS using Cmd+C.

Testing notes

I have tested with the following separately:

Read only permissions where user does not have write permissions.

Screenshot 2022-02-20 at 10 49 28 PM

Readonly field conditions to disable a field even for user with write permissions

Screenshot 2022-02-20 at 10 50 30 PM

And I was unable to reproduce the issue both when copying text from the field and from the revisions drawer preview. The text could still be selected and copied.

Screenshot 2022-02-20 at 10 56 40 PM

The two things I've noticed is that text cannot be copied in the revision's diff and for relational fields' displayed value. Which was why I have asked which field are you trying to copy the text from.

Revision's diff, where the text cannot be copied.

Screenshot 2022-02-20 at 10 58 55 PM

Relational field's display text cannot be copied. Example below shows an O2M field.

Screenshot 2022-02-20 at 11 00 12 PM Screenshot 2022-02-20 at 11 00 42 PM

@HerrBlauwasser
Copy link
Author

During creation of screenshots, I noticed that I was not aware of important details. Sorry for any confusion...

The problem affects only the code editor. Readonly fields are affected the same as fields not having writing permissions, but only for the code editor. The problem is not limited to CTRL-c, any way of copying is affected: CTRL-c, Linux-style copying by selecting, as well as right-klick, which does not even show the option to copy. Tested on Linux/Chrome, Linux/Firefox and Windows/Firefox.

How to reproduce:

  1. Create a text field with code editor as interface and set it to readonly. Default settings for everything else.

Screenshot at 2022-02-20 16-20-13

Screenshot at 2022-02-20 16-20-22

Screenshot at 2022-02-20 16-20-29

  1. Try copying the value from the code editor

Screenshot at 2022-02-20 16-23-30

Thank you very much again!

@licitdev
Copy link
Member

@DL1PZ I was able to reproduce the issue. Thank you for the additional info and screenshots.

@licitdev licitdev changed the title Copying to clipboard does not work for disabled fields Copying to clipboard does not work for disabled code interface Feb 20, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants