Prevent movement of user interface when keyboard appears

ios, mobile-safari, sencha-touch

Solution

Unfortunately, Apple wants this behavior, but someone suggested a little hack using window.scrollTo():

listeners: {
    focus: function() {
        window.scrollTo(0,0);
    }
}

Problem

I'm working on a little app which uses Sencha Touch 2 for the user interface. Right now I'm running it in Safari on my iPad and iPhone. My problem is that whenever I tap a text field, Safari brings up the virtual keyboard and pushes the whole web view upwards, off the screen. This doesn't look very natural, since the top-toolbar is not visible anymore. Here are two screenshots which demonstrate the problem. In the second screenshot you can see the effect when the keyboard is visible. Is there a way to prevent this behavior, and have Safari resize the user interface instead?

Original source