-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Support for copying to clipboard #4853
Comments
This would be great, as long as we don't do the spammy text-selection hijacking. |
Would be a neat addition to @koshka Would you be interested in implementing this and contributing it to the project? |
Hello! As per the Contributing Guidelines I'd like to show an "intent to implement", a Pull request for this issue. I plan on using something like: https://www.sitepoint.com/javascript-copy-to-clipboard/ , and clipboard.js for any other reference 😄 I agree with @jridgewell, and try to make the component specifically display the text that will be copied. |
@torch2424: That'd be lovely. |
I wonder if requiring the show the URL is a little too opinionated. Awesome you are working on this @torch2424!! |
Just Finished this. Probably have a PR opened in today, or within the next week. Currently wrapping up the validator, and some Docs |
It was concluded that due to lack of cross browser support, this is infeasible. Should not be a GFI candidate anymroe. |
|
We should definitely support copy to clipboard.
…On Thu, Mar 29, 2018 at 10:01 AM, Taymon A. Beal ***@***.***> wrote:
<amp-story> supports this. Given that, is there any reason
<amp-social-share> can't?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4853 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAFeTz-gjsvL4eH1__wmbfjwNR20IoS4ks5tjRNigaJpZM4J3dmW>
.
|
As a drive-by comment: we implement this with an |
Just wanted to bump this a little bit, totally forgot, but @sebastianbenz and I discussed how this would be really helpful for AMP By Example, and the upcoming |
Here's the iframe solution: https://ampbyexample.com/advanced/copy_button/preview/ |
@samthor Thank you for this! Great that we have a link in the issue in case someone else comes across this 👍 |
For amp.dev it'd be great to have the ability to copy code snippets from the documentation samples. For this case It'd be great to have a simple copy action which specifies a node and recursively concatenates all child text nodes to a single string which is then added to the clipboard:
|
Hey @torch2424 are there any updates on this? It'd be really fantastic to have this available for amp.dev. |
@sebastianbenz My apologies! Wasn't sure if the iframe solution would suffice or not. I will pass this around the team in mountain view, and see if we can get some traction on this 👍 |
cc @nainar - can you investigate prioritization? |
I'll let @nainar investigate/prioritize this. Feel free to reach out to me on this topic, I actually made an extension for this about a year and a half ago, so before we start implementation perhaps we can possibly re-use some of that code (probably not though). Thanks for catching this @rudygalfi ! 😄 |
@aghassemi You marked this "soon" about 6 months ago. Is there any plans to work on it ? Thank you ! |
Hi @catherinehoule, would the solution outlined on https://ampbyexample.com/advanced/copy_button/preview/ work for you and unblock you? |
@aghassemi That works but feels a bit hacky... I was wondering if there was plans to make this issue happening since it's been sitting in |
@aghassemi Would you happen to have a solution that works with a screen reader using the arrows. |
Using Iframe for copy seems to be a overkill. What is the best solution? |
Just came across this. I have a WordPress plugin for adding syntax highlighting to code blocks (which is used on blog.amp.dev). Various users have asked for a Copy to Clipboard button to go next to the code block: westonruter/syntax-highlighting-code-block#192 But this is blocked by not having the capability in AMP. |
Any updates? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
Will this still get implemented? |
Just an update to those who are searching for clipboard function - since it's hard to find answer in the internet, you can use the copy(), copy-success and copy-error: example code:
tap:input_id_to_copy.copy(); Use this to specify the input you want to copy. For example: copy-success:element_id_to_show_for_success.show(); Utilize this to display a success message when the value is copied successfully. Example: copy-error:element_id_to_show_for_error.show(); Apply this function to show an error message if the copying fails. For instance: or simply use this one:
|
Description
Our pages allow users to copy the share URL, (in addition to basic social sharing). To allow our pages to support AMP, we need to be able to copy content to clipboard without JS.
Current feature is provided by a 3rd party tool clipboardjs. We cannot find equivalent functionality.
Example
https://gfycat.com/BareSecondaryFlamingo
Click on the embed </> button below the video
Click on the copy to clipboard icon
The text was updated successfully, but these errors were encountered: