Hey guys, we have been getting complaints from customers that the Copy to Clipboard button doesn’t work on our website for code snippets.
Here’s an example of a page where the Copy button doesn’t work correctly: Onboard Microsoft Azure to Stratusphere
There aren’t any errors or warnings that appear in the Chrome Dev Tools when this fails to work, so I’m kind of at a loss of where to look to try to get this resolved.
Has anyone else had a similar problem? How can I make sure that the copy button works successfully?
Hey @trevor_stratus - thanks for posting in the Community!
I understand that there seems to be an issue with your coding in some of your page’s Copy buttons. I’d like to tag in some of our experts in this subject matter for some insight how we may be able to best troubleshoot this. @Stephanie-OG, @elizheleva, and @stefen - any insight here?
Thanks for taggint me @STierney !
@trevor_stratus - usually for a copy button like that, there would be a snippet of JavaScript somewhere that finds the relevant text and copies it to the clipboard.
I’m not seeing any scripts that do that, the button element itself is just <button>Copy</button> (usually it might have some more information: a class or ID, info on the target text… etc.)
It looks like you might be using an Atlas theme. I can’t seem to find this being native theme functionality anywhere, was this added in as custom functionality? It doesn’t look like a module in the blog post text, so where is the script that makes it copy to clipboard?