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

Container option #368

Merged
merged 8 commits into from
May 29, 2017
Merged

Container option #368

merged 8 commits into from
May 29, 2017

Conversation

johnsenpeder
Copy link
Contributor

@johnsenpeder johnsenpeder commented Jan 20, 2017

PR based on code changes/idea by @alexalexalex-s #155 (comment)

Fixes issues with using clipboard in bootstrap modals etc.

@iest
Copy link

iest commented Feb 23, 2017

@zenorocha any progress on this? This would also solve an issue when using with react-modal2.

Happy to help make improvements to get it moving.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This issue isn't exclusive to bootstrap — you get the same issue with react-modal2 or any other library that changes the focus.

Might be worth clarifying this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iest updated the text

@johnsenpeder
Copy link
Contributor Author

Any chance this might get merged anytime soon? :)

@adrianbj
Copy link

I would like to see this also. I need to refer to document.documentElement, rather than document.body. Currently I am hacking clipboard.min.js to do this, but I assume this PR would let me do this more gracefully?

@seanmhanson
Copy link

+1 for getting this resolved and merged

@ryantheleach
Copy link

Thanks for merging this I had run into an issue with jQuery Mobile popups. I suspect this library with this PR will fix this.

If only I knew about the issues I would see when I decided to use SO to come up with a copy script rather then use your library. Then maybe I wouldn't have spent 5 hours debugging. well, Still probably would have, but would have found the container option faster.

https://stackoverflow.com/questions/44303217/why-does-copying-stop-working-from-the-context-menu

robmazur added a commit to robmazur/vue-clipboard2 that referenced this pull request Mar 18, 2018
Implements the container option from clipboard.js (zenorocha/clipboard.js#368)
nle-odoo added a commit to odoo-dev/odoo that referenced this pull request Oct 24, 2018
Same issue as in 902e484. In some browser (eg. firefox) the container
parameter of ClipboardJS is needed if the focus is inside the modal so
the copy work.

See information on:
zenorocha/clipboard.js#368

opw-1902040
closes odoo#28117
robodoo pushed a commit to odoo/odoo that referenced this pull request Oct 25, 2018
Same issue as in 902e484. In some browser (eg. firefox) the container
parameter of ClipboardJS is needed if the focus is inside the modal so
the copy work.

See information on:
zenorocha/clipboard.js#368

opw-1902040
closes #28117
cdll pushed a commit to x78w/clipboard.js that referenced this pull request Jul 14, 2020
* 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
cdll pushed a commit to x78w/clipboard.js that referenced this pull request Jul 14, 2020
cdll added a commit to x78w/clipboard.js that referenced this pull request Jul 14, 2020
cdll added a commit to x78w/clipboard.js that referenced this pull request Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants