Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15001] iOS: keyboardframechanged does not fire

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-09-19T22:50:27.000+0000
Affected Version/sRelease 2.1.4, Release 3.1.1, Release 3.1.2, Release 3.2.0
Fix Version/s2013 Sprint 19, 2013 Sprint 19 API, Release 3.2.0
ComponentsiOS
LabelsiOS, iOS6, iPad-Mini, module_keyboard, qe-testadded, titanium
ReporterAshish Nigam
AssigneeVishal Duggal
Created2013-08-29T13:29:11.000+0000
Updated2013-10-16T09:22:16.000+0000

Description

keyboardframechanged event does not fire in case of iPad-Mini running iOS version 6.0.1. Sample code to test the issue:
var win = Ti.UI.createWindow({
    backgroundColor:'#ffffff'
});

var txtArea = Ti.UI.createTextArea({
    borderWidth : 2,
    borderColor : '#bbb',
    borderRadius : 5,
    color : '#888',
    font : {
        fontSize : 12,
        fontWeight : 'bold'
    },
    textAlign : 'left',
    top : 10,
    left : 10,
    right : 10,
    suppressReturn : false
});

win.add(txtArea);

Ti.App.addEventListener("keyboardframechanged", function(e) {
    alert(" keyboardFrame.height"+ e.keyboardFrame.height);  //console.log does not always work well.
    txtArea.setBottom(e.keyboardFrame.height);
});

win.addEventListener('focus', function(e) {
    txtArea.focus();
});

win.open();

Attachments

FileDateSize
iPadMini_TextAreaFocus.mov2013-09-09T10:58:20.000+00004212964

Comments

  1. Sabil Rahim 2013-08-29

    [~ingo][~dcassenti] Tested the above code on ipad mini running 6.1.3 , iPad 4 running iOS beta 6 and could reproduce the issue. This is definitely **not** a iOS 7 issue. Don't have a 6.0.1 device with me so leaving it open for now.
  2. Blain Hamon 2013-08-29

    Suggesting that the customer see if they can recreate the issue with the following fixed code:
       var win = Ti.UI.createWindow({
           backgroundColor:'#ffffff'
       });
        
       var txtArea = Ti.UI.createTextArea({
           borderWidth : 2,
           borderColor : '#bbb',
           borderRadius : 5,
           color : '#888',
           font : {
               fontSize : 12,
               fontWeight : 'bold'
           },
           textAlign : 'left',
           top : 10,
           left : 10,
           right : 10,
           suppressReturn : false
       });
        
       win.add(txtArea);
        
       Ti.App.addEventListener("keyboardframechanged", function(e) {
           alert(" keyboardFrame.height"+ e.keyboardFrame.y);  //console.log does not always work well.
           txtArea.setBottom(win.rect.height - e.keyboardFrame.y + 30); //That's 20 for the nav bar, 10 for bottom margin.
       });
        
       win.addEventListener('focus', function(e) {
           txtArea.focus();
       });
        
       win.open();
       
    If this solves their issue, will be moving to mark invalid; the keyboard height itself doesn't change, it just slides offscreen. The original code in the ticket didn't take that into consideration. Marking ticket as needs more info for customer feedback.
  3. Vishal Duggal 2013-09-17

    Pull pending master - https://github.com/appcelerator/titanium_mobile/pull/4707
  4. Pragya Rastogi 2013-10-16

    Tested with: OSX: 10.8.5 Xcode:5.0 Appcelerator Studio: 3.2.0.201310152434 SDK:3.2.0.v20131014204636 acs:1.0.7 alloy:1.2.2 npm:1.3.2 titanium:3.2.0 titanium-code-processo:1.0.3 Device: iPad Mini 6.0

JSON Source