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

Using copyFromContent from ClipboardService does not give callback in copyResponse$ #250

Open
saranglakare opened this issue Aug 6, 2020 · 3 comments
Assignees

Comments

@saranglakare
Copy link

From your documentation it seems that I should always get call back whenever a copy is successful. I am getting callbacks when copied using template modifications. But when I copy something using copyFromContent there seems to be no callback.

I tested on https://stackblitz.com/github/maxisam/ngx-clipboard as well and the alert is not displayed when Copy from Service button is clicked.

Am I missing something?

@maxisam maxisam self-assigned this Aug 6, 2020
@maxisam
Copy link
Owner

maxisam commented Aug 6, 2020

Should use copy instead. I probably should deprecated copyFromContent. Thx

@KemalPajevic
Copy link

KemalPajevic commented Apr 28, 2023

Please consider reopening this.
Sometimes we need to pass the container to the service, for instance if the content is copied from a modal.
See the issue described here.

In my case I have an Angular app that uses an Ionic-based framework, and if the content resides in a modal I need to do something like this to get the copy functionality to work:

this.clipboard.copyFromContent(
  stringToCopy,
  document.querySelector('ion-modal') ?? undefined
);

@maxisam maxisam reopened this Apr 29, 2023
@maxisam
Copy link
Owner

maxisam commented Apr 29, 2023

@KemalPajevic is the current behavior still working for you?

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

No branches or pull requests

3 participants