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

clicking an element inside the 'target' throws exception. #119

Closed
pawlufelice opened this issue Nov 6, 2015 · 7 comments
Closed

clicking an element inside the 'target' throws exception. #119

pawlufelice opened this issue Nov 6, 2015 · 7 comments

Comments

@pawlufelice
Copy link
Contributor

I have a button with a span in it. The Clipboard instance is created with the button as the target, but clicking on the span throws an error (listener checks if target has required attributes). The onClick should use e.currentTarget instead of e.target I think:

    onClick(e) {
        if (this.clipboardAction) {
            this.clipboardAction = null;
        }

        this.clipboardAction = new ClipboardAction({
            action  : this.action(e.currentTarget),
            target  : this.target(e.currentTarget),
            text    : this.text(e.currentTarget),
            trigger : e.currentTarget,
            emitter : this
        });
    }

Thanks,
Paul

@pawlufelice
Copy link
Contributor Author

@louisameline
Copy link

👍

@deronsizemore
Copy link

👍

+1 for me on this issue

@decentral1se
Copy link

🚀

@m90
Copy link

m90 commented Nov 10, 2015

👍

@zenorocha
Copy link
Owner

Fixed on v1.5.4! Thanks @pawlufelice for contributing!

@zenorocha
Copy link
Owner

And let me know if this new release works for you ;)

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

No branches or pull requests

6 participants