iFrame blocks copy to clipboard

3 Comments

  • Eric Nelson
    Zendesk Developer Advocacy
    Hey Luke,

    Can you provide a code snippet so we can see how you're trying to accomplish this? 
     
    Thanks!
    0
  • Luke Szanto

    Sure thing, I am trying to copy text to the clipboard using this function:

    function executeCopy(text) {
    // create input to insert text into
    var input = document.createElement('textarea');
    document.body.appendChild(input);
    input.value = text;

    // focus and highlight text
    // input.focus();
    input.select();

    // copy the text
    document.execCommand('Copy');

    // remove unneeded input
    //input.remove();

    // notify user
    alert('Copied to clipboard');
    }
    0
  • Tipene Hughes
    Zendesk Developer Advocacy
    Hey Luke,
     
    I haven’t been able to replicate the issue you’re seeing in Google Chrome. After doing a bit of digging, it appears that this is an issue specific to the Firefox browser.
     
    Can you try running the app in Google Chrome and see if everything runs correctly there?
     
    Thanks,
     
    Tipene
    0

Please sign in to leave a comment.

Powered by Zendesk