I am using the copyToClipboard
in my application. It works good in Chrome and Firefox browsers except in IE and Firefox.
In I.E. (esp. version 11), on click of Copy, it introduces a native browser popup, asking to Allow or Deny and also it scrolls to bottom of the page.
The popup introduction is fine, but I need to stop the scrolling downwards.
Code:
$scope.copyData = function(id) {
var copyAreaObject = document.createElement('textarea');
$scope.copyInitialize(id, copyAreaObject);
var selector = document.querySelector('#copyWrapper');
selector.select();
document.execCommand('copy');
document.body.removeChild(copyAreaObject);
};