Skip to content

Seemingly successful copy event does not actually place anything on the clipboard #348

@tobinibot

Description

@tobinibot

I have a situation where everything appears to be indicating a successful copy event (namely, the success event is firing with the correct text), but nothing is actually being placed on the system clipboard.

Expected behaviour

I have a modal with a long link in it that I would like to copy and I’ve added a button which should allow the user to easily copy it. Clicking this “Copy link” button should log the results of the success event to the console, alert the copied text, and (obviously) copy the content to the clipboard.

Actual behaviour

All the correct data is logged to the console and alerted on screen, but the content of the clipboard is not updated.

My guess is that the root of the issue is probably related somehow to the fact that the contents of the modal are loaded dynamically.

Minimal example

https://jsfiddle.net/tobinibot/uz0w7r7k/16/

Hopefully there is not too much going on here. I can try to pare it down more if I need to, but hopefully this will allow you to reproduce the problem easily enough.

Browsers affected

I'm on the latest macOS Sierra (10.12.1). The latest Firefox (50.0.2) and Chrome (55.0.2883.75) are both broken. Safari 10.01 actually seems to work, and the latest Safari Technical Preview (Preview 18) does as well. I have no access to IE or Edge at the moment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions