mirror of
https://github.com/zenorocha/clipboard.js.git
synced 2023-08-10 21:12:48 +03:00
Prevents scroll jump on iOS when using "data-clipboard-text"
Thanks to @geraldarthur at #369
This commit is contained in:
@@ -64,7 +64,6 @@ class ClipboardAction {
|
||||
this.fakeElem.style[ isRTL ? 'right' : 'left' ] = '-9999px';
|
||||
// Move element to the same position vertically
|
||||
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', '');
|
||||
|
||||
Reference in New Issue
Block a user