react-copy-to-clipboard
react-copy-to-clipboard copied to clipboard
The behavior that Selection.addRange() merges existing Range
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.
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)
The problem is the data-tip
that you have in your tag. But I don't know how to fix it :(
same problem