copy-to-clipboard
copy-to-clipboard copied to clipboard
Selection.addRange() is deprecated
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.
This should be handled in https://github.com/sudodoki/toggle-selection
@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?
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.
+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.
@sudodoki Would it be possible to add a maintainer to this repo to help get in some vital fixes like this one?
@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?
By https://github.com/sudodoki/copy-to-clipboard/pull/63#issuecomment-376483748 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.
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.