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

UI: Fix copy to clipboard for insecure deployments #13777

Merged
merged 1 commit into from
Feb 1, 2021

Conversation

j3rem1e
Copy link
Contributor

@j3rem1e j3rem1e commented Jan 30, 2021

Issue: #13776

What I did

If navigator.clipboard is not defined, then the copy-to-dashboard uses execCommand('copy').

How to test

  • Is this testable with Jest or Chromatic screenshots? No
  • Does this need a new example in the kitchen sink apps? No
  • Does this need an update to the documentation? No

@shilman shilman changed the title Uses execCommand if navigator.clipboard is not available UI: Fix copy to clipboard for insecure deployments Feb 1, 2021
@shilman shilman added the patch:yes Bugfix & documentation PR that need to be picked to main branch label Feb 1, 2021
@shilman shilman added this to the 6.1.x milestone Feb 1, 2021
Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 💯

@shilman shilman merged commit 27067d1 into storybookjs:next Feb 1, 2021
@j3rem1e j3rem1e deleted the copy-source branch February 1, 2021 11:14
@shilman shilman added the patch:done Patch/release PRs already cherry-picked to main/release branch label Feb 2, 2021
shilman added a commit that referenced this pull request Feb 2, 2021
UI: Fix copy to clipboard for insecure deployments
@ghengeveld
Copy link
Member

Why don't we just use copy-to-clipboard? It's already used in various other places, so it already gets bundled anyway.

@j3rem1e
Copy link
Contributor Author

j3rem1e commented Feb 5, 2021

AFAIK copy-to-clipboard use execCommand which has been removed in #10526 because of jsdom failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants