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

Web UI copy-to-clipboard not working #483

cpaelzer opened this issue May 7, 2019 · 2 comments


None yet
2 participants
Copy link

commented May 7, 2019

Note: This is not a UA-client issue, but I file it here for you to re-route it accordingly.

That failing button is defined as:

<div class="p-code-snippet">
  <input type="text"
  <button class="p-code-snippet__action">Copy to clipboard</button>

Affected Browsers (What is in Bionic as of today):

  • Chrome 74.0.3729.108-1
  • Firefox 66.0.3+build1-0ubuntu0.18.04.1

The css is from the vanilla framework, inspection shows vanilla-framework-version-1.8.1.css

Based on that I guessed that some JS in the vanilla framework would assign an onclick to this class, but I haven't found any JS other than the google analytics. Of course my 20 year old web-foo might just be outdated.


But knowing that we use that style all over out tutorials and such I tried there and it worked fine e.g. on provisioning maas

Inspecting (and comparing) that showed the same button tech:
<button class="p-code-snippet__action">Copy to clipboard</button>

But the broken ( had no Event Listeners at all on that button.
While the tutorial had several registered, those were a bunch of google analytics tags but more importantly also this:


This seems to be the missing code

    n.commandLine = function() {
        document.querySelectorAll(".p-code-snippet").forEach(function(a) {
            var e = a.querySelector(".p-code-snippet__action")
              , n = a.querySelector(".p-code-snippet__input");
            e && n && e.addEventListener("click", function(e) {
                try {

And knowing that we find in the main page the loaders:

        <!-- Polyfill functions -->
    <script src="/static/js/build/main.min.js?v=a3555ea"></script>
    <script src=""></script>

And the broken page has nothing there:


Please fix to carry the code to be active on that copy-to-clipboard button

@OddBloke OddBloke changed the title Web UI coyp-to-clipboard not working Web UI copy-to-clipboard not working May 7, 2019


This comment has been minimized.

Copy link

commented May 8, 2019

As mentioned, this is an issue with the UA frontend not ua-client or ua-contracts specifically. Forwarding this issue to the appropriate project


This comment has been minimized.

Copy link

commented May 8, 2019

@blackboxsw blackboxsw closed this May 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.