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

Handle "container" option of clipboardJS #206

Merged
merged 2 commits into from
Jun 9, 2020
Merged

Handle "container" option of clipboardJS #206

merged 2 commits into from
Jun 9, 2020

Conversation

enna
Copy link
Contributor

@enna enna commented May 27, 2020

This PR handles the container option of ClipboardJS, as described here.This container option allows the clipboard to work in modals, which will fix issue #180

Copy link
Owner

@jkusa jkusa left a comment

Choose a reason for hiding this comment

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

@enna thanks for picking up #180! A few comments:

  • Can we call the arg container (in alignment with Clipboard.JS) and do something like this:
  container : typeof container === 'string' ? document.querySelector(container) : container
});
  • Also, would you mind documenting this option in the README?

@enna
Copy link
Contributor Author

enna commented Jun 2, 2020

@jkusa sure, no prob. :)

README.md Outdated
@@ -60,6 +60,7 @@ http://jkusa.github.io/ember-cli-clipboard
- `clipboardText` - string value or action that returns a string to be copied
- `clipboardTarget` - selector string of element from which to copy text
- `clipboardAction` - string value of operation: `copy` or `cut` (default is copy)
- `container` - selector string of element, or element, containing the component. If you want to use the component inside a modal, this property is mandatory and should referred to the modal element.
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
- `container` - selector string of element, or element, containing the component. If you want to use the component inside a modal, this property is mandatory and should referred to the modal element.
- `container` - selector string or element object of containing element. "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".

@jkusa
Copy link
Owner

jkusa commented Jun 2, 2020

@enna change look good. Just a small tweak to the readme and we should be good.

@enna
Copy link
Contributor Author

enna commented Jun 4, 2020

All should be good now @jkusa :)

@jkusa jkusa merged commit 9734d8f into jkusa:master Jun 9, 2020
@dcyriller dcyriller deleted the handle-container-option branch June 9, 2020 08:37
@drewdaemon
Copy link

We could really use this improvement! Any plan on cutting an NPM release with container support @jkusa?

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

Successfully merging this pull request may close these issues.

3 participants