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

Two clicks required to copy sometimes #100

Open
mhuggins opened this issue Oct 25, 2018 · 14 comments
Open

Two clicks required to copy sometimes #100

mhuggins opened this issue Oct 25, 2018 · 14 comments

Comments

@mhuggins
Copy link

This is an issue in copy-to-clipboard itself, which would be fixed if this PR is merged: sudodoki/copy-to-clipboard#63. Since copy-to-clipboard seems to be abandoned, is there a scenario where this repo might use a supported fork or anything along those lines?

@nkbt
Copy link
Owner

nkbt commented Oct 25, 2018

Last response was

Would it be possible to add a maintainer to this repo to help get in some vital fixes like this one?

Sure, anyone who is willing could become one, should I add you?

So I reckon someone could totally do that

@suhongyan
Copy link

please...may be...Why do I have to click twice to copy the address of the current click?

@ekokotov
Copy link

@nkbt any news about a possible fix ? Spasibo!

@nkbt
Copy link
Owner

nkbt commented Apr 11, 2019

No updates from the original lib yet ¯_(ツ)_/¯... Not much we can do here

@mhuggins
Copy link
Author

mhuggins commented Apr 11, 2019

Yeah, the original lib owner (@sudodoki) would like a way to reproduce it, and I don't have a suggestion on how to do that. It happened for me in one case, but not another, and I didn't have time to invest to see why -- forking and fixing the lib was my route.

@nkbt
Copy link
Owner

nkbt commented Apr 11, 2019

Well, @mhuggins... So if you did not have time to invest to see why some elusive problem exists, what makes you think lib maintainers have time to invest to do it?

@mhuggins
Copy link
Author

I don't, but there's an open PR that fixes the issue that he won't pull in either. Many other users of the lib have commented on the PR stating that it fixes the issue.

@sudodoki
Copy link

@mhuggins it's not that I won't pull it, it just that removeAllRanges is already called as I mentioned in here so I don't get what is the case when you need to call it twice and asked for help digging to the bottom of this. There were some minor changes in recent version of upstream lib, and I wonder whether that might affect this issue in any way

@well-monkey
Copy link

any news about a possible fix ?

@mhuggins
Copy link
Author

@sudodoki I see your point. I didn't get to dig into it at the time, but I do know that the change solved the problem for me. It was a very specific scenario where I encountered it, but other scenarios worked, so I'm not sure what the difference was.

@ghost
Copy link

ghost commented Aug 22, 2019

"Solved" by adding:
document.getElementById('ID_OF_BUTTON').click();
to onCopy handler.
...

@helloalicesmith
Copy link

helloalicesmith commented Nov 22, 2019

I also ran into this problem. This component uses function from pocket copy-to-clipboard, which takes the text as the first argument and copy it into the buffer.

@developdeez
Copy link

Same. Any alternative packages to recommend?

@developdeez
Copy link

developdeez commented Feb 8, 2020

export default (words) => { const textField = document.createElement("textarea"); textField.innerText = words; document.body.appendChild(textField); textField.select(); document.execCommand("copy"); };
Need to hide the textarea but it should work

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

8 participants