Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi! When using react-copy-to-clipboard, which is using this copy-to-clipboard module, I've encountered an issue in IE11.
In the function that was attached to the "copy" event using the
mark.addEventListener("copy", function(e) { ... })
an error is thrown in IE11 due to thee.clipboardData
being undefined. There's atry/catch
present, but we do not end up in thecatch
block due to the fact that the error is thrown inside of the callback attached to the "copy" event and not inside of the root levelfunction copy(text, options) { ... }
.I fixed this by checking explicitly if the
e.clipboardData
isundefined
, and using thewindow.clipboardData
if this is the case. I had to add some conversion of options as well, as per: https://msdn.microsoft.com/en-us/ie/ms536744(v=vs.94).Could you have a look at this please? Thanks a lot!