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

Discontiguous selection is not supported. #5

Closed
moroshko opened this issue Aug 9, 2015 · 2 comments
Closed

Discontiguous selection is not supported. #5

moroshko opened this issue Aug 9, 2015 · 2 comments

Comments

@moroshko
Copy link
Contributor

moroshko commented Aug 9, 2015

When I use <div> rather than <button> inside <CopyToClipboard>, I get a warning in the console, and nothing is copied to the clipboard.

<CopyToClipboard text={'hey'}>
  <div>Copy to clibpoard</div>
</CopyToClipboard>

Discontiguous selection is not supported.

Codepen

Any idea why is this happening?

@nkbt
Copy link
Owner

nkbt commented Aug 9, 2015 via email

@nkbt
Copy link
Owner

nkbt commented Aug 10, 2015

Hm, that seems like a known issue: sudodoki/copy-to-clipboard#2

I tested with span, button, div and other tags. It seems like using something other then button gives this error. Also I can avoid the issue by using onMouseDown rather then onClick. But then it becomes even more interesting, I get error The given range and the current selection belong to two different document fragments.

Comes from https://chromium.googlesource.com/chromium/blink.git/+/master/Source/core/editing/DOMSelection.cpp

As a possible solution I can lock component to render button passing all props to it so it is possible to style it.

@nkbt nkbt closed this as completed in fdee461 Aug 21, 2015
@nkbt nkbt mentioned this issue Sep 16, 2015
nkbt added a commit that referenced this issue Sep 30, 2015
Parallelshell works in Windows, fixes #4
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