mirror of
https://github.com/zenorocha/clipboard.js.git
synced 2023-08-10 21:12:48 +03:00
Merge 13e4613f2e into b5bc00f2e4
This commit is contained in:
@@ -18,7 +18,7 @@ class ClipboardAction {
|
|||||||
if (this.text && this.target) {
|
if (this.text && this.target) {
|
||||||
throw new Error('Multiple attributes declared, use either "target" or "text"');
|
throw new Error('Multiple attributes declared, use either "target" or "text"');
|
||||||
}
|
}
|
||||||
else if (this.text) {
|
if (this.text) {
|
||||||
this.selectFake();
|
this.selectFake();
|
||||||
}
|
}
|
||||||
else if (this.target) {
|
else if (this.target) {
|
||||||
@@ -41,6 +41,8 @@ class ClipboardAction {
|
|||||||
this.fakeElem = document.createElement('input');
|
this.fakeElem = document.createElement('input');
|
||||||
this.fakeElem.style.position = 'absolute';
|
this.fakeElem.style.position = 'absolute';
|
||||||
this.fakeElem.style.left = '-9999px';
|
this.fakeElem.style.left = '-9999px';
|
||||||
|
this.fakeElem.style.width = 0;
|
||||||
|
this.fakeElem.style.height = 0;
|
||||||
this.fakeElem.setAttribute('readonly', '');
|
this.fakeElem.setAttribute('readonly', '');
|
||||||
this.fakeElem.value = this.text;
|
this.fakeElem.value = this.text;
|
||||||
this.selectedText = this.text;
|
this.selectedText = this.text;
|
||||||
|
|||||||
Reference in New Issue
Block a user