sudodoki/copy-to-clipboard

Unable to get property 'clearData' of undefined or null reference

BogdanHossu opened this issue · 2 comments

Hello,

Currently I got hit with the issue mentioned above that Unable to get property 'clearData' of undefined or null reference. This issue happens only when users they use IE 11 and unfortunately, there is no way of making them use another browser for now.

Outputting the message from Sentry:
Unable to get property 'clearData' of undefined or null reference

 e.stopPropagation();
 if (options.format) {
    e.preventDefault();
    e.clipboardData.clearData();
    e.clipboardData.setData(options.format, text);
 }
});
  document.body.appendChild(mark);
  range.selectNodeContents(mark);
  selection.addRange(range);

Is there a solution for this issue? Thank you

wdlb commented

I think this PR should solve the issue: #93

@wdlb Thank you for your great work!