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

copy not working with Microsoft Edge #237

Open
maerni opened this issue Mar 4, 2020 · 16 comments
Open

copy not working with Microsoft Edge #237

maerni opened this issue Mar 4, 2020 · 16 comments

Comments

@maerni
Copy link

maerni commented Mar 4, 2020

Hi

We use ngx-clipboard with the following code to copy something to clipboard:

public copyToClipboard(text: string) {
if (this.clipboardService.isSupported && this.clipboardService.isCopySuccessInIE11()) {
this.clipboardService.copyFromContent(text);
} else {
}
}

We use ngx-clipboard 12.2.1 with Angular 7.2.15.

With Microsoft Internet Exporer 11 and Google Chrome it works fine.

With Microsoft Edge it does not work.

What we have to do?

Thanks very much.

@maxisam
Copy link
Owner

maxisam commented Mar 4, 2020

what version of edge? it works on my edge.

@maerni
Copy link
Author

maerni commented Mar 4, 2020

We use the following version

Microsoft Edge 42.17134.1098.0
Microsoft EdgeHTML 17.17134

Perhaps we use the wrong version of ngx-clipboard?

Should we use a 11.x version with Angular 7.x?

Or is our code wrong?

@maxisam
Copy link
Owner

maxisam commented Mar 4, 2020

Oh, i don't have version 42.

I am on Version 80.0.361.62

@maerni
Copy link
Author

maerni commented Mar 4, 2020

On another machine I have Microsoft Edge 44.18362.449.0 there it also did not work.

Then I downloaded Microsoft Edge 80.0.361.62. With this version it works.

But do have any idea, why it does not work with the old edge? Because in our company on all machines the version 42.x is installed...

@maxisam
Copy link
Owner

maxisam commented Mar 4, 2020

Do you have any error message in console?

@maerni
Copy link
Author

maerni commented Mar 4, 2020

no, the call

this.clipboardService.copyFromContent(text);

returns false but there is no error message

@maxisam
Copy link
Owner

maxisam commented Mar 4, 2020

I just tested it on browserstack. It works on Edge 18, which is version 44.

@maxisam
Copy link
Owner

maxisam commented Mar 4, 2020

But seriously, I doubt there are lots of people use Edge 18 anyway. Upgrading Edge seems like a good idea.

@maerni
Copy link
Author

maerni commented Mar 4, 2020

Did you also test it with version 42?

@maerni
Copy link
Author

maerni commented Mar 4, 2020

Very special. I tryed my application on Edge 17 (version 42) and Edge 18 (version 44) on browserstack and it did not work...

Perhaps we use ngx-clipboard wrong?

How would you use it for copying over the ClipboardService?

@maxisam
Copy link
Owner

maxisam commented Mar 4, 2020

You can check the example. https://stackblitz.com/github/maxisam/ngx-clipboard

I used angular 9 to test it. However, there are not much different after 11.x.

@maxisam
Copy link
Owner

maxisam commented Mar 4, 2020

I doubt you use it wrong because you said it works on IE 11.

@maerni
Copy link
Author

maerni commented Mar 4, 2020

Which version of ngx-clipboard should we use with Angular 7.x?

I will check your example and look, if we do something wrong.

@maerni
Copy link
Author

maerni commented Mar 4, 2020

I could not find any difference to your code.

In app.module.ts I have the following code:

import { ClipboardModule } from 'ngx-clipboard';
imports: [...ClipboardModule...],

In my component (it is a service) I have the following code:

import { ClipboardService } from 'ngx-clipboard';
constructor(private clipboardService: ClipboardService) {}

this.clipboardService.copyFromContent('blablabla');

@maxisam
Copy link
Owner

maxisam commented Mar 4, 2020

v12 should be able to work with angular 7. But I doubt that is the problem.

@maerni
Copy link
Author

maerni commented Mar 4, 2020

Very special

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

2 participants