Adds explanations on textarea styling #143 #179 #180

This commit is contained in:
Zeno Rocha 2016-02-04 11:25:00 -08:00
parent 4c9e29a0dc
commit bc9bcdd678

View File

@ -58,11 +58,16 @@ export default class ClipboardAction {
this.fakeHandler = document.body.addEventListener('click', () => this.removeFake());
this.fakeElem = document.createElement('textarea');
// Prevent zooming on iOS
this.fakeElem.style.fontSize = '12pt';
// Reset box model
this.fakeElem.style.border = '0';
this.fakeElem.style.padding = '0';
this.fakeElem.style.margin = '0';
// Move element out of screen horizontally
this.fakeElem.style.position = 'absolute';
this.fakeElem.style.fontSize = '12pt'; // Prevent zooming on iPhones.
this.fakeElem.style[ isRTL ? 'right' : 'left' ] = '-9999px';
// Move element to the same position vertically
this.fakeElem.style.top = (window.pageYOffset || document.documentElement.scrollTop) + 'px';
this.fakeElem.setAttribute('readonly', '');
this.fakeElem.value = this.text;