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
* Allow container option to fix bugs related to bootstrap modals etc.
* Updated readme to reflect addition of container option
* Name link
* Removed test log
* Remove unwanted whitespace
* Refactored description
Copy file name to clipboardExpand all lines: readme.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -145,6 +145,15 @@ new Clipboard('.btn', {
145
145
});
146
146
```
147
147
148
+
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.
149
+
See [Issue #155 (comment)](https://github.com/zenorocha/clipboard.js/issues/155#issuecomment-273124130)
150
+
151
+
```js
152
+
newClipboard('.btn', {
153
+
container:document.getElementById('#modal')
154
+
});
155
+
```
156
+
148
157
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.
0 commit comments