react-copy-to-clipboard icon indicating copy to clipboard operation
react-copy-to-clipboard copied to clipboard

The behavior that Selection.addRange() merges existing Range

Open amaury1093 opened this issue 6 years ago • 3 comments

Hi. Using the latest version of react-copy-to-clipboard, I have an issue:

My code:

const CopyContainer = ({ address, children, ...otherProps }) => (
  <CopyToClipboard text={address}>
    <a className="account" data-tip="Copy address">
      <input autoFocus type="hidden" />
      {children}
      <ReactTooltip
        effect="solid"
        event="mouseover"
        eventOff="mouseout click"
        place="bottom"
      />
    </a>
  </CopyToClipboard>
);

It's <a> tag with a tooltip on hover. On click, I have the following message, and the text is not copied.

index.js:41 [Deprecation] The behavior that Selection.addRange() merges existing Range and the specified Range was removed. See https://www.chromestatus.com/features/6680566019653632 for more details.

If I click another time, then no warning, and the text is copied.

amaury1093 avatar Jun 18 '18 12:06 amaury1093

If it really the case, it is more of an upstream https://npm.im/copy-to-clipboard issue rather then this one. react-copy-to-clipboard is a very thin layer on top of it.

Since there is no codepen to check, I am unable to verify the problem (douh... need to add an issue template with codepen as a requirement for all ui libs)

nkbt avatar Jun 23 '18 01:06 nkbt

The problem is the data-tip that you have in your tag. But I don't know how to fix it :(

alejandrosobko avatar Aug 03 '18 12:08 alejandrosobko

same problem

Kvodnon avatar Nov 15 '21 04:11 Kvodnon