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

Selection.addRange() is deprecated #63

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jakubzitny
Copy link
Collaborator

Merging ranges is deprecated for a while now https://www.chromestatus.com/features/6680566019653632.

Removing all ranges before adding was suggested in https://stackoverflow.com/a/43443101.

Merging ranges is deprecated for a while now https://www.chromestatus.com/features/6680566019653632.

Removing all ranges before adding was suggested in https://stackoverflow.com/a/43443101.
@jakubzitny jakubzitny changed the title remove all ranges before adding a range for copying Selection.addRange() is deprecated and will be removed from Chrome Mar 27, 2018
@jakubzitny jakubzitny changed the title Selection.addRange() is deprecated and will be removed from Chrome Selection.addRange() is deprecated Mar 27, 2018
@sudodoki
Copy link
Owner

This should be handled in https://github.com/sudodoki/toggle-selection

@rolandliwag
Copy link

@sudodoki Just to clarify -- do you mean that this pull request does not belong in copy-to-clipboard or that this change should also be applied in toggle-selection?

@jakubzitny
Copy link
Collaborator Author

It looks like it already is in toggle-selection but I think only explicitly calling removeAllRanges() like this helped us. I will find some time to confirm / find the actual problem.

@mhuggins
Copy link

+1 I need this change too. Doesn't work for me in some scenarios without this change. Otherwise, the user has to click twice before copying works.

@mhuggins
Copy link

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

@sudodoki
Copy link
Owner

sudodoki commented Oct 25, 2018

@mhuggins

Doesn't work for me in some scenarios without this change. Otherwise, the user has to click twice before copying works.

can you please provide a repro case / list scenarios / investigate further. I don't think @jakubzitny wasn't able to find out the root cause, and I don't have time for it.

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?

@sudodoki
Copy link
Owner

By #63 (comment) I meant that removeAllRanges is called in here https://github.com/sudodoki/toggle-selection/blob/gh-pages/index.js#L25 so this is kinda weird. Would be nice if anyone could come with env description / steps to reproduce.

@ATheCoder
Copy link

Any updates on this?

I get this error on my app and when I do, the text is not copied and the user has to click again.

Screen Shot 2019-12-10 at 12 02 08 PM

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.

6 participants