mirror of
https://github.com/zenorocha/clipboard.js.git
synced 2023-08-10 21:12:48 +03:00
Fixes #320
This commit is contained in:
@@ -63,7 +63,10 @@ class ClipboardAction {
|
|||||||
this.fakeElem.style.position = 'absolute';
|
this.fakeElem.style.position = 'absolute';
|
||||||
this.fakeElem.style[ isRTL ? 'right' : 'left' ] = '-9999px';
|
this.fakeElem.style[ isRTL ? 'right' : 'left' ] = '-9999px';
|
||||||
// Move element to the same position vertically
|
// Move element to the same position vertically
|
||||||
this.fakeElem.style.top = (window.pageYOffset || document.documentElement.scrollTop) + 'px';
|
let yPosition = window.pageYOffset || document.documentElement.scrollTop;
|
||||||
|
this.fakeElem.addEventListener('focus', window.scrollTo(0, yPosition));
|
||||||
|
this.fakeElem.style.top = yPosition + 'px';
|
||||||
|
|
||||||
this.fakeElem.setAttribute('readonly', '');
|
this.fakeElem.setAttribute('readonly', '');
|
||||||
this.fakeElem.value = this.text;
|
this.fakeElem.value = this.text;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user