diff --git a/index.html b/index.html index e6efe17..555ee12 100644 --- a/index.html +++ b/index.html @@ -169,6 +169,12 @@ clipboard.on('error', function(e) { } }); +

For use in Bootstrap Modals or with any other library that changes the focus you'll want to set the focused element as the container value.

+ +
new Clipboard('.btn', {
+    container: document.getElementById('#modal')
+});
+

Also, if you are working with single page apps, you may want to manage the lifecycle of the DOM more precisely. Here's how you clean up the events and objects that we create.

var clipboard = new Clipboard('.btn');