2

I'm having an issue with textfields in Sencha Touch 2, this is only occurring in iOS 7 and working fine in iOS 6 and Android.

The issue is when you tap a field the keypad opens but the cursor disappears, it should be focus on selected textfield but it does not. You have to tap the textfield again to focus.

I have checked this issue on iOS 6 and android (on devices as well as on simulators), working fine but not on iOS 7 only.

Is anybody having this issue...?

Is this a bug in sencha or should i missing something, please advice.

Thank you..

Avin
  • 301
  • 1
  • 3
  • 12

3 Answers3

0

I have found this to be directly related to two things:

  1. centered: true
  2. pack: 'center'

When I removed those lines, my app started playing nice. The challenge is to find an alternative way to center your panels.

tbraun89
  • 2,246
  • 3
  • 25
  • 44
0

I spent days figuring this out. Actually there is a problem with Sencha understanding the ViewPort height. In your index.html add a script block with the following code

if (window.device && parseFloat(window.device.version) == 7.0) {
   document.body.style.paddingTop = "20px";
   Ext.Viewport.setHeight(Ext.Viewport.getWindowHeight() - 20);
}

This does two things for you

  1. It Provides enough space on Top to display the activity bar
  2. It sets the Viewport height to be that of screen height, irrespective of the keyboard being present or not.

Also, If your app works in Portrait and Landscape mode, you will need to add these lines in your Viewport.js (or Main.js)

initialize: function(){
    Ext.Viewport.on('orientationchange', 'handleOrientationChange', this, {buffer: 0 });
},

handleOrientationChange: function(){
     try{
           if (parseFloat(window.device.version) == 7.0) {
            Ext.Viewport.setHeight(Ext.Viewport.getWindowHeight() - 20);
            }else{
            Ext.Viewport.setHeight(Ext.Viewport.getWindowHeight());
            }
      }catch(e){
                // do nothing
      }
},

And Yes, Make sure they Keyboard Bounce is TRUE in true (if you are using cordova). This will make sure your field does not get hidden.

Hope this works for you.

0

add height="device-height" in viewport meta tag, fixes the issue.

ios7 issues with webview focus when using keyboard html

Community
  • 1
  • 1
Dinesh Kumar DJ
  • 479
  • 3
  • 15