Android 4.1.1 + Keyboard + Scroll + inputs


#1

Hi there,

On Android 4.1.1 (Galaxy S3 Mini), I have issues with editing some text inputs that are near the keyboard (30 pixels top of the keyboard when it is open). When I say issues, I say I can’t tip or edit the text input.

The ionic keyboard plugin is installed and I am using the nightly build of Ionic.

The first fix I found was to scroll a little bit down and then the input was editable again.

I finally figure out that it was related to the keyboard because I commented some code (see below) and then it was working. I don’t know if it is related to the measurement of the keyboard or the scroll trying to adjust to show the input. I just know it was not working.

function keyboardInit() {
  // if( keyboardHasPlugin() ) {
  //   window.addEventListener('native.keyboardshow', keyboardNativeShow);
  //   window.addEventListener('native.keyboardhide', keyboardFocusOut);

  //   //deprecated
  //   window.addEventListener('native.showkeyboard', keyboardNativeShow);
  //   window.addEventListener('native.hidekeyboard', keyboardFocusOut);
  // }
  // else {
  //   document.body.addEventListener('focusout', keyboardFocusOut);
  // }

  // document.body.addEventListener('ionic.focusin', keyboardBrowserFocusIn);
  // document.body.addEventListener('focusin', keyboardBrowserFocusIn);

  document.body.addEventListener('orientationchange', keyboardOrientationChange);

  document.removeEventListener('touchstart', keyboardInit);
}

#2

Thanks!

Improved a lot my issues described here : Android 2.3 - Can't edit/delete text in input


#3

What I would say in this moment, when I spent 2 days with solving similar issue.

Just: you are my hero man


#4

Well took me 12 hours of hard work to find out.
What I think is that ionic think the input is below the keyboard and try to do something about it… Obviously, it is not working. It could be great to have an Ionic tech guy to check this.

I share my app with you guys : https://play.google.com/store/apps/details?id=com.whattheflight.WhatTheFlight&hl=en


#5

I don’t know if anyone is having this problem still. If you are , please look at http://ionicframework.com/docs/api/page/keyboard/

You probably need to have `` in your

// Ionic Starter App

// angular.module is a global place for creating, registering and retrieving Angular modules
// 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
// the 2nd parameter is an array of 'requires'
angular.module('starter', ['ionic'])

    .run(function($ionicPlatform) {
        $ionicPlatform.ready(function() {

            ionic.Platform.isFullScreen = true;
            // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
            // for form inputs)
            if(window.cordova && window.cordova.plugins.Keyboard) {
                cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
            }
            if(window.StatusBar) {
                StatusBar.styleDefault();
            }
        });
    })