Results 1 to 3 of 3

Thread: Fields are jumping on android when the keyboard is raising

  1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    2
    Vote Rating
    0
      0  

    Default Fields are jumping on android when the keyboard is raising

    Hello,
    On my android application where the keyboard appears, the whole screen is not scrolling up but only the fields are scrolling. This code is working perfectly on iOS and I don't have the same effect : when the keyboard appear the whole screen is scrolling up.
    Here is the code :

    initComponent: function() {


    this.layout = {
    type: 'vbox',
    align: 'stretch'
    },


    this.items = [{
    xtype: 'panel',
    height: 90,
    layout: 'fit',
    html: ''
    + '<div style="position:absolute; width:100%; bottom:10px; text-align:center;">'
    + '<img src="img/logo-300.png" />'
    + '</div>'
    }, {
    flex: 1,
    layout: 'card',
    activeItem: 0,
    defaults: {
    bodyStyle: Ext.is.Phone ? 'padding: 20px;' : 'padding: 20px 200px;',
    },
    dockedItems: [{
    xtype: 'toolbar',
    dock: 'top',
    pack: 'center',
    items:[{
    xtype: 'spacer'
    }, {
    xtype: 'segmentedbutton',
    items: [{
    pressed: true,
    text: '&nbsp;&nbsp;Connexion&nbsp;&nbsp;',
    handler: Ext.createDelegate(this.setActiveCard, this, [0], false)
    }, {
    text: '&nbsp;&nbsp;Inscription&nbsp;&nbsp;',
    handler: Ext.createDelegate(this.setActiveCard, this, [1], false)
    }]
    }, {
    xtype: 'spacer'
    }]
    }],
    items: [{
    xtype: 'formpanel',
    scroll: 'vertical',
    url: API_URL + 'xxxxxx.php',
    loadMask: false,
    submitOnAction: true,
    id: 'form-login',
    defaults: {
    labelWidth: 120,
    autoCorrect: false,
    autoComplete: false,
    useClearIcon: true
    },
    baseParams:{
    PART_ID:Branding.PART_ID,
    DEVICE:UserInfo.DEVICE,
    LDEVICE: navigator.device?(device.name + '/' + device.platform + '/' + device.version)'none/none/none')
    },
    items: [{
    label: 'Identifiant',
    xtype: 'textfield',
    value: (localStorage.getItem('username') || ''),
    name : 'LOGON',
    cls: 'toUpper'
    }, {
    label: 'Mot de passe',
    xtype: 'passwordfield',
    value: '',
    name : 'PASSWD'
    }, {
    label: 'Keep Id',
    xtype: 'togglefield',
    name: 'MEMORIZE',
    labelWidth:200,
    value: (localStorage.getItem('memorize') || 0),
    cls:'field-MEMORIZE'
    }, {
    layout: {
    type: 'hbox'
    },
    items:[{
    xtype: 'button',
    flex: 1,
    text: 'OK',
    scope: this,
    handler: this.login
    }]
    }, {
    html: '<center><span style="color:black; font-size:12px; text-decoration:underline; color:blue">Mot de passe oubli...</span></center>',
    listeners: {
    scope: this,
    afterRender: function(panel) {
    this.mon(panel.body, 'tap', function() {
    openUrl('http://www.xxxxxxx.com/index.htm');
    }, this);
    }
    }
    },
    {
    html: '<center><div style="color:#C4C4C4; font-size:12px">V1.01 copyright XXXXX 2011</div></center>'
    }],
    listeners


    Thanks for your answer if you have an idea.

  2. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,050
    Answers
    3976
    Vote Rating
    1381
      0  

    Default

    Android and iOS handle the keyboard differently. On iOS it works great but Android isn't the best.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Nov 2011
    Posts
    51
    Answers
    7
    Vote Rating
    0
      0  

    Default

    It isn't as bad on a real phone. And it helps having Auto Correct and Suggestions turned off for the keyboard in the settings (to make things more bearable during testing on the emulator). The fields don't jump on a real phone (at least the one i am testing on, maybe slower phones are different) because when changing fields the keyboard disappears and reappears quicker than that the fields can move down and up. Also, i noticed things got a bit less jumpy after i removed "scroll: vertical" from the panel, it was still scrollable after that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •