03-26-2013 03:30 PM
I have a BB10 WebWorks app which uses the following meta tag:
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />
And I want to disable the zoom that occurs when the user taps on a text input to give it focus.
I've also tried using the HandheldFriendly meta tag to no avail:
<meta name=”HandheldFriendly” content=”True” />
Am I missing something?
Solved! Go to Solution.
03-26-2013 03:41 PM - edited 03-26-2013 03:44 PM
You should be setting the viewport like this which will prevent any nasty zooming accidents:
There's also a KB Article on the viewport here: http://supportforums.blackberry.com/t5/Web-and-Web
<head> <script> var meta = document.createElement("meta"); meta.setAttribute('name','viewport'); meta.setAttribute('content','initial-scale='+ (1/window.devicePixelRatio) + ',user-scalable=no'); document.getElementsByTagName('head').appendChi
ld(meta); </script> </head>
03-26-2013 04:04 PM
Hi, thanks for the reply. Setting the viewport as in that code sample simply causes the CSS pixels to be equivalent to the physical pixels, i.e. it makes my UI very small.
This also doesn't solve the behaviour of the viewport zooming in to the text input when it receives focus. By the way, I see this behaviour on one input, but not another... I'm investigating the differences between the two.
03-28-2013 12:38 PM
Turns out I can only reproduce this on a Dev Alpha device; the behaviour does not occur on a Z10. Chalk this one up to pre-release software, I suppose!
09-04-2013 04:01 AM
I seem to be getting this problem using physical Z10 and on the latest VM. Seems to happen when repeatedly hitting the backspace key. I'm using Sencha Touch and have tried their viewport config as well as that above with no affect.