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

feat(CodeSnippet): add copy functionality with external package #8105

Merged
merged 4 commits into from
Mar 22, 2021

Conversation

tw15egan
Copy link
Member

Alternate to #8103
Closes #6995
Closes #4448

This PR adds in the same functionality as #8103, but uses the external copy-to-clipboard package to handle copying for better browser support. This will still prevent copying if a user has already provided an onClick

Changelog

New

  • copy-to-clipboard added as a dependency
  • copy functionality is added if an onClick is not provided to CodeSnippet

Testing / Reviewing

Test inline and single components, the code should be copied. Test multi and playground, the code should not be copied

@netlify
Copy link

netlify bot commented Mar 16, 2021

Deploy preview for carbon-elements ready!

Built with commit 1b6c4ce

https://deploy-preview-8105--carbon-elements.netlify.app

@netlify
Copy link

netlify bot commented Mar 16, 2021

Deploy preview for carbon-components-react ready!

Built without sensitive environment variables with commit 1b6c4ce

https://deploy-preview-8105--carbon-components-react.netlify.app

@kodiakhq kodiakhq bot merged commit c022111 into carbon-design-system:main Mar 22, 2021
@tw15egan tw15egan deleted the add-copy-alternate branch March 3, 2022 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate adding copy functionality by default to CodeSnippet React Code Snippet copy button not working
4 participants