Skip to content

Copying key to clipboard adds padding #661

Open
@bkochendorfer

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions