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

Imperative API does not work #127

Closed
avindra opened this issue Nov 11, 2015 · 5 comments
Closed

Imperative API does not work #127

avindra opened this issue Nov 11, 2015 · 5 comments
Labels

Comments

@avindra
Copy link

avindra commented Nov 11, 2015

new Clipboard('', {
    text: function(trigger) {
        return "TEST1234";
    }
});

This does not set my clipboard to TEST1234. Am I missing something?

@kafeltz
Copy link

kafeltz commented Nov 12, 2015

Missing some dom element to work with? I would rather make a global function to do this job than installing a plugin for this. What am I missing?

@zenorocha
Copy link
Owner

Hey @avindra, the first argument is missing.

Here's a simple working example: http://jsfiddle.net/zenorocha/5b8r8hg5/1/

@avindra
Copy link
Author

avindra commented Nov 12, 2015

I don't understand - are you saying that some abritrary DOM element is required? If so... why?

@zenorocha
Copy link
Owner

Yes, user interaction is required for security reasons. That's how the browser works, not my fault ;)

@FagnerMartinsBrack
Copy link

Yes, user interaction is required for security reasons. That's how the browser works, not my fault ;)

@zenorocha I suggest documenting those things, to prevent abstraction leak, see #130.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants