crockpotveggies
crockpotveggies

Reputation: 13300

Blank keyboard input on Android Jellybean (PhoneGap)?

I have a weird issue with Jellybean keyboard. When my users upgraded their OS, anytime they tried to use the keyboard to input data it just doesn't type. Period.

It's weird since you can indeed focus on a text area, but typing on the keyboard has no output.

Anyone aware of a fix? To get more specific, my platform is PhoneGap 1.9.0, I don't have any other raw java files in the project, and my application manifest is below:

<application
        android:icon="@drawable/icon"
        android:label="@string/app_name"
        android:screenOrientation="portrait"
        android:configChanges="orientation|keyboardHidden|screenSize">
        <activity
            android:name=".App"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>

My onCreate is very simple and is below as well:

public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      super.setIntegerProperty("loadUrlTimeoutValue", 60000);
      super.loadUrl("file:///android_asset/www/index.html");
      this.appView.setInitialScale(100);
    }

Here's the source for the form being generated by Sencha Touch 2:

config: {
        padding: 20,
        items: [
        {
            xtype: 'image',
            src: 'resources/img/logo-splash.png',
            width:250,
            height: 229,
            baseCls: 'login-splash'
        },
        {
            xtype: 'fieldset',
            defaults: {  
                required: true,  
                labelAlign: 'left',  
                labelWidth: '35%'  
            },  
            items: [  
            {  
                xtype: 'emailfield',  
                name : 'email',  
                label: 'Email',  
                clearIcon: true  
            }, {  
                xtype: 'passwordfield',  
                name : 'password',  
                label: 'Password',  
                clearIcon: true  
            }],

        }, 
        {
            xtype: 'button',
            text: 'Login',
            ui: 'action',
            id: 'loginBtn',
            baseCls: 'btn-orange ui-rd'
        }
        ]
    },

And then the final HTML output by Sencha (viewed on a webkit browser):

<div class="x-inner x-form-fieldset-inner" id="ext-element-129"><div class="x-container x-field-text x-field x-label-align-left x-field-required x-field-labeled x-form-label-nowrap x-empty" id="ext-emailfield-1"><div class="x-form-label" id="ext-element-131" style="width: 35% !important; "><span id="ext-element-132">Email</span></div><div class="x-component-outer" id="ext-element-130"><div id="ext-input-1" class="x-field-input"><input id="ext-element-133" class="x-input-el x-form-field x-input-email" type="email" autocapitalize="off" name="email"><div class="x-clear-icon" id="ext-element-135"></div><div class="x-field-mask" id="ext-element-134"></div></div></div></div><div class="x-container x-field-text x-field x-label-align-left x-field-required x-field-labeled x-form-label-nowrap x-empty" id="ext-passwordfield-1"><div class="x-form-label" id="ext-element-137" style="width: 35% !important; "><span id="ext-element-138">Password</span></div><div class="x-component-outer" id="ext-element-136"><div class="x-field-input" id="ext-input-2"><input class="x-input-el x-form-field x-input-password" type="password" id="ext-element-139" autocapitalize="off" name="password"><div class="x-clear-icon" id="ext-element-141"></div><div class="x-field-mask" id="ext-element-140"></div></div></div></div></div>

Thanks!

For clarification: the problem is exactly when the field is focused the keyboard pops up, but when you hit the keys it doesn't fill in the text

Upvotes: 2

Views: 1666

Answers (1)

crockpotveggies
crockpotveggies

Reputation: 13300

I was able to resolve the issue by upgrading PhoneGap from 1.9.0 to 2.0.0.

I am not sure what was the exact cause, but I also made a post to the community here: http://community.phonegap.com/nitobi/topics/blank_keyboard_input_on_android_jellybean

My instinct is that it was related to a way Cordova was handling Javascript events and keyboard events. But nonetheless it's working now.

Upvotes: 1

Related Questions