mirror of
https://github.com/zenorocha/clipboard.js.git
synced 2023-08-10 21:12:48 +03:00
Updates fake element to use visually hidden styles
Uses the h5bp technique as seen in https://github.com/h5bp/html5-boilerplate/blob/v5.0.0/src/css/main.css#L 126-L140
This commit is contained in:
parent
c12c610b22
commit
2a3be43534
@ -56,9 +56,7 @@ export default class ClipboardAction {
|
||||
this.fakeHandler = document.body.addEventListener('click', () => this.removeFake());
|
||||
|
||||
this.fakeElem = document.createElement('textarea');
|
||||
this.fakeElem.style.position = 'absolute';
|
||||
this.fakeElem.style.left = '-9999px';
|
||||
this.fakeElem.style.top = (window.pageYOffset || document.documentElement.scrollTop) + 'px';
|
||||
this.fakeElem.style.cssText = 'border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px';
|
||||
this.fakeElem.setAttribute('readonly', '');
|
||||
this.fakeElem.value = this.text;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user