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 key to clipboard adds padding #661

Open
bkochendorfer opened this issue Aug 31, 2021 · 1 comment
Open

Copying key to clipboard adds padding #661

bkochendorfer opened this issue Aug 31, 2021 · 1 comment

Comments

@bkochendorfer
Copy link
Member

bkochendorfer commented Aug 31, 2021

Describe the bug
When you click Copy on the Keys section of the UI the key is copied to system clipboard but has left padding.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://people.mozilla.org/p/bkochendorfer
  2. Scroll down to Keys
  3. Click Copy next to ssh key.
  4. Paste buffer somewhere, you will notice left padding is added.

Expected behavior
When copying we should copy the contents of the key not including left padding.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Debian 11 Bullseye*
  • Browser: Firefox Nightly
  • Version 93.0a1

Additional context
I believe this is the javascript generating this issue, https://github.com/mozilla-iam/dino-park-front-end/blob/master/src/components/ui/Key.vue#L49. According to MDN Document.execCommandis deprecated so perhaps moving this to clipboard api would help https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API

@gene1wood
Copy link
Contributor

Interestingly there are two different things going on here.

For the GPG key, indeed the copy function is the problem.
For the SSH key, the actual key is formatted in the DOM with extra padding which would also need to be fixed.

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

No branches or pull requests

2 participants