You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because of these lines in good-listener which is what clipboard.js uses for listening to clicks, specifically because it uses event delegation and listens on body, it's consequently impossible to use this directive inside anything that needs to stop propagation because then the click is never triggered on body. For instance, my use case (simplified) is like this:
<div class="container" ng-click="open = !open">
<div class="row-header">
<!-- Header content -->
</div>
<div class="body-content animate-show" ng-show="open" stop-propagation>
<span ngclipboard data-clipboard-text="This will never be copied" ngclipboard-success="doSomething()">Copy</span>
</div>
</div>
Obviously, that's contrived, cause here you could easily move the ng-click further down, but the point it illustrates can't always be worked around. I mean, if any parent, anywhere on the page above ngclipboard calls stopPropagation, the text will never be copied.
There's an issue on clipboard.js related to this here, but I don't see how the proposed solution there could be implemented using this directive.
The text was updated successfully, but these errors were encountered:
Because of these lines in
good-listener
which is whatclipboard.js
uses for listening to clicks, specifically because it uses event delegation and listens on body, it's consequently impossible to use this directive inside anything that needs to stop propagation because then the click is never triggered onbody
. For instance, my use case (simplified) is like this:Obviously, that's contrived, cause here you could easily move the ng-click further down, but the point it illustrates can't always be worked around. I mean, if any parent, anywhere on the page above
ngclipboard
calls stopPropagation, the text will never be copied.There's an issue on
clipboard.js
related to this here, but I don't see how the proposed solution there could be implemented using this directive.The text was updated successfully, but these errors were encountered: