Added iOS work-around for preventing unintentional page zooms when returning focus from a soft-key control to the normal keyboard control

This commit is contained in:
Jeff Parsons 2017-01-29 22:17:57 -08:00 committed by Jeff Parsons
commit 3c376df42c
6 changed files with 22 additions and 4 deletions

View file

@ -1487,6 +1487,15 @@ class Video8080 extends Component {
if (Web.isUserAgent("iOS")) {
eTextArea.setAttribute("autocapitalize", "off");
eTextArea.setAttribute("autocorrect", "off");
/*
* One of the problems on iOS devices is that after a soft-key control is clicked, we need to give
* focus back to the above textarea, usually by calling cmp.updateFocus(), but in doing so, iOS may
* also "zoom" the page rather jarringly. While it's a simple matter to completely disable zooming,
* by fiddling with the page's viewport, that prevents the user from intentionally zooming. A bit of
* Googling reveals that another way to prevent those jarring unintentional zooms is to simply set the
* font-size of the text control to 16px. So that's what we do.
*/
eTextArea.style.fontSize = "16px";
}
eVideo.appendChild(eTextArea);

View file

@ -7368,6 +7368,15 @@ Video.init = function()
if (web.isUserAgent("iOS")) {
eTextArea.setAttribute("autocapitalize", "off");
eTextArea.setAttribute("autocorrect", "off");
/*
* One of the problems on iOS devices is that after a soft-key control is clicked, we need to give
* focus back to the above textarea, usually by calling cmp.updateFocus(), but in doing so, iOS may
* also "zoom" the page rather jarringly. While it's a simple matter to completely disable zooming,
* by fiddling with the page's viewport, that prevents the user from intentionally zooming. A bit of
* Googling reveals that another way to prevent those jarring unintentional zooms is to simply set the
* font-size of the text control to 16px. So that's what we do.
*/
eTextArea.style.fontSize = "16px";
}
eVideo.appendChild(eTextArea);