Skip to content

Commit

Permalink
Prevent auto-zooming on an iphone by making the text area size approp…
Browse files Browse the repository at this point in the history
…riate size. Fixes Issue 180.
  • Loading branch information
speedplane committed Feb 4, 2016
1 parent a88bb77 commit bd6dc9e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/clipboard-action.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export default class ClipboardAction {

this.fakeElem = document.createElement('textarea');
this.fakeElem.style.position = 'absolute';
this.fakeElem.style.fontSize = '12pt'; // Prevent zooming on iPhones.
this.fakeElem.style[ isRTL ? 'right' : 'left' ] = '-9999px';
this.fakeElem.style.top = (window.pageYOffset || document.documentElement.scrollTop) + 'px';
this.fakeElem.setAttribute('readonly', '');
Expand Down

0 comments on commit bd6dc9e

Please sign in to comment.