Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15967] iOS: keyboardToolbar fails to disappear

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-11-04T19:12:18.000+0000
Affected Version/sn/a
Fix Version/sRelease 3.2.1, Release 3.4.2, Release 3.5.0, Release 4.0.0
ComponentsiOS
Labelsmodule_keyboard, qe-manualtest
ReporterStephen Feather
AssigneePedro Enrique
Created2013-12-10T19:26:33.000+0000
Updated2014-12-03T23:46:39.000+0000

Description

Expectation

Expect keyboardToolbar to disappear AND NEVER RETURN when the parent containing its window is closed.

Reality

keyboardToolbar slides off the screen to the right instead of down, and will slide in right to left under new keyboard

Demonstration

App in the Wild: http://screencast.com/t/U78lP3Lhpv Test Case Video: http://screencast.com/t/ig9D9PpePY2a

Testcase

This test case shows the weird animation (tool bar left to right, instead of sliding up with keyboard), but the bar does not stick as it does in the video. The test case matches the view layers of the affected app.
var tabGroup = Ti.UI.createTabGroup();

var textWindow = Titanium.UI.createWindow({ 
    backgroundColor:'#fff'
});
  
var textfield = Ti.UI.createTextField({keyboardType: Ti.UI.KEYBOARD_NUMBER_PAD, returnKeyType: Ti.UI.RETURNKEY_DONE,  bubbleParent: false, backgroundColor: '#262626',  border: 1, width: 100});
var toolbarDone = Ti.UI.createButton({systemButton: Titanium.UI.iPhone.SystemButton.DONE});
var flexSpace = Titanium.UI.createButton({systemButton : Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE});
toolbarDone.addEventListener('click', function(){
            textfield.blur();
            
        });
textfield.keyboardToolbarColor = '#80c342';
textfield.keyboardToolbar = [flexSpace, toolbarDone];
var scrlView = Ti.UI.createScrollView({layout:'vertical', scrollType: 'vertical', width: Ti.UI.FILL});
scrlView.add(textfield);
textWindow.add(scrlView);

textWindow.addEventListener('focus', function(){
    textfield.value = '';
})

var secondaryWindow = Ti.UI.createWindow({backgroundColor: 'red'});

var mainWindow = Ti.UI.createWindow({backgroundColor: '#fff'});
var bigButton = Ti.UI.createButton({height: 150, width: 150, title: 'Button', backgroundColor: 'red'});

mainWindow.add(bigButton);

var tab1 = Ti.UI.createTab({window: mainWindow, title: 'Main'});
var tab2 = Ti.UI.createTab({window: secondaryWindow, title: 'Second'});

bigButton.addEventListener('click', function(){
    tab1.open(textWindow);
});

tabGroup.addTab(tab1);
tabGroup.addTab(tab2);

tabGroup.open();

Comments

  1. Stephen Feather 2013-12-11

    Regression? TIMOB-6490
  2. Stephen Feather 2013-12-24

    This prevents the shipping of an app.
  3. Ingo Muschenetz 2013-12-24

    Bumped priority.
  4. Vishal Duggal 2014-01-03

    Pull pending against master https://github.com/appcelerator/titanium_mobile/pull/5184
  5. Vishal Duggal 2014-01-06

    Backport to 3_2_X https://github.com/appcelerator/titanium_mobile/pull/5188
  6. Wilson Luu 2014-01-07

    Closing ticket as fixed. Verified the keyboard's toolbar disappears correctly and does not exhibits the strange behavior i.e. keyboard's toolbar appears from bottom to top after pressing on the text field and will disappear from top to bottom after pressing the back nav button. Tested on: Appcelerator Studio, build: 3.2.1.201401052158 SDK build: 3.2.1.v20140106134045, 3.3.0.v20140106141645 CLI: 3.2.0 Alloy: 1.3.1-beta Xcode: 5.0.2 Devices: iphone 4s (6.0.1), iphone 5s (7.0.2), iphone simulator retina 4-inch (7.0.3), iphone simulator (6.1)
  7. Paras Mishra 2014-01-07

    Keyboard's tool bar is working as expected Verified the fix on: Tested on: Device : iPhone 5s , iOS version : 7.0.2 SDK: 3.3.0.v20140106195650 SDK: 3.2.1.v20140106195644 CLI version : 3.2.0 OS : MAC OSX 10.9 Alloy: 1.3.1-beta ACS: 1.0.11 npm:1.3.2 Appcelerator Studio, build: 3.2.1.201401061716 titanium-code-processor: 1.1.0 XCode : 5.0.2
  8. Ygor Lemos 2014-04-10

    I'm still experiencing this bug on 3.2.2.GA I was able to reproduce this bug inside a tableView with many textfields, once you setData on the tableView or ListView and a keyboard is open, the toolbar remains on screens even if call blur on all textFields. Follows a test case that reproduce this issue. Tested on iOS 7.1 Simulator using Titanium 3.2.2.GA
       var w = Ti.UI.createWindow();
       
       var rows = [];
       
       var x1 = Ti.UI.createTextField({
           hintText: "This is a hint text",
           width: 200,
           height: 44,
           top: 20,
           bottom: 20,
           keyboardType: Ti.UI.KEYBOARD_NUMBER_PAD,
           min: 0,
           max: 10
       });
       
       var dismissButtonToolBar1 = Ti.UI.createButton({
           title: "OK",
           style: Ti.UI.iPhone.SystemButtonStyle.DONE
       }, function(){
           x1.blur();
       });
       
       dismissButtonToolBar1.addEventListener("click", function() {
           x1.blur();
       })
       
        x1.setKeyboardToolbar([dismissButtonToolBar1]);
        x1.setKeyboardToolbarColor("#eaeaea");
        x1.setKeyboardToolbarHeight(44);
       
        var r1 = Ti.UI.createTableViewRow();
        r1.add(x1);
       
       rows.push(r1);
       
       var x2 = Ti.UI.createTextField({
           hintText: "This is a hint text",
           width: 200,
           height: 44,
           top: 20,
           bottom: 20,
           keyboardType: Ti.UI.KEYBOARD_NUMBER_PAD,
           min: 0,
           max: 10 
       });
       
       var dismissButtonToolBar2 = Ti.UI.createButton({
           title: "OK",
           style: Ti.UI.iPhone.SystemButtonStyle.DONE
       }, function(){
           x2.blur();
       });
       
       dismissButtonToolBar2.addEventListener("click", function() {
           x2.blur();
       })
       
        x2.setKeyboardToolbar([dismissButtonToolBar2]);
        x2.setKeyboardToolbarColor("#eaeaea");
        x2.setKeyboardToolbarHeight(44);
        
        var r2 = Ti.UI.createTableViewRow();
        r2.add(x2);
       
       rows.push(r2);
       
       
       var x3 = Ti.UI.createTextField({
           hintText: "This is a hint text",
           width: 200,
           height: 44,
           top: 20,
           bottom: 20,
           keyboardType: Ti.UI.KEYBOARD_NUMBER_PAD,
           min: 0,
           max: 10 
       });
       
       var dismissButtonToolBar3 = Ti.UI.createButton({
           title: "OK",
           style: Ti.UI.iPhone.SystemButtonStyle.DONE
       });
       
       dismissButtonToolBar3.addEventListener("click", function() {
           x3.blur();
       })
       
        x3.setKeyboardToolbar([dismissButtonToolBar3]);
        x3.setKeyboardToolbarColor("#eaeaea");
        x3.setKeyboardToolbarHeight(44);
       
        var r3 = Ti.UI.createTableViewRow();
        r3.add(x3);
       
       rows.push(r3);
       
       
       var bd = Ti.UI.createButton({
           title: "Crash",
           width: 100,
           height: 80,
       });
       
       bd.addEventListener("click", function() {
           t.setData(rows);
       });
       
       var r4 = Ti.UI.createTableViewRow();
       r4.add(bd);
       rows.push(r4);
       
       var t = Ti.UI.createTableView({data: rows});
       
       w.add(t);
       
       w.open();
       
  9. Ygor Lemos 2014-04-10

    Follows a video showing the bug still persists: http://youtu.be/4HL2S0ToCGQ
  10. Samuel Dowse 2014-07-28

    Re-opening ticket: Mac OSX 10.9.4 Appcelerator Studio, build: 3.3.0.201407111535 Titanium SDK, build: 3.3.0.GA Titanium CLI, build: 3.3.0 Alloy: 1.4.0 Used test code provided by [~ygbr], and was able to reproduce the issue.
  11. Pedro Enrique 2014-08-07

    PR: https://github.com/appcelerator/titanium_mobile/pull/5956
  12. Stephen Feather 2014-08-08

    App that was working ok (previous race condition resolved), when rebuilt with 3.3.0.GA experiencing problem. !http://content.screencast.com/users/Stephen_Feather/folders/Jing/media/1b3977fe-a4ef-46b2-915d-a124699f7629/00000540.png! (pulling Pedro's patch to test)
  13. Pedro Enrique 2014-08-08

    [~sfeather] I submitted a fix in my last comment, you can get me changes from the PR and give it another try. *EDIT* I just noticed you tested with my changes: (pulling Pedro's patch to test) What is the use case? what is the code doing exactly to get to that?
  14. Stephen Feather 2014-08-08

    Don't know yet, was submitted to us from a beta tester through a 3rd party. trying to get the details. Patched and pushed a build to the ios testers to play with to see if it comes back. In our case, the keyboard was probably open when they closed a window
  15. Pedro Enrique 2014-08-12

    [~sfeather] I've been trying to reproduce this is some different ways, but so far I'm unsuccessful. If you could provide something we'll take another look.
  16. Stephen Feather 2014-08-12

    Pedro, I hate to call something fixed if reproduction is/was difficult. However, applied your PR to 3.3.0.GA, pushed to testers, haven't heard of it appearing again. But absence of information is not verification to the contrary.
  17. Pedro Enrique 2014-08-12

    [~sfeather] understood, we're not merging it yet, this needs more regression testing. Keep using that custom sdk with the fix for now and let us know if this comes up again. If I understood correctly, it did happened once, right? according to your previous comment.
  18. Stephen Feather 2014-08-13

    yes happened with 3.3.0.GA, still dont have tester details.
  19. Jon Alter 2014-08-28

    Functional Test fail:

    Mac OSX 10.9.4 Titanium SDK, build: 3.4.0 w/ https://github.com/appcelerator/titanium_mobile/pull/5956 Titanium CLI, build: 3.3.0 iPhone 5s 7.1.1

    Steps to reproduce

    1. Run Ygor's test code above. 2. Add around 8 numbers to rows 2 and 3. 3. Click "Crash" repeatedly (it takes a few tries but eventually the keyboardToolbar will disappear).

    Expected behavior

    Keyboard and keyboardToolbar remain visible

    Actual behavior

    Toolbar disappears and keyboard remains visible
  20. Jon Alter 2014-11-04

    Cannot reproduce the issue that caused the functional test to fail in my last comment.

    Functional Test pass:

    Mac OSX 10.9.4 Titanium SDK, master w/ https://github.com/appcelerator/titanium_mobile/pull/5956 Titanium CLI, build: 3.4.0 iPhone 5c 7.1, iPhone 5c 8.1

    PR merged

  21. Vishal Duggal 2014-11-04

    PR's mereged master - https://github.com/appcelerator/titanium_mobile/pull/5956 3_4_X - https://github.com/appcelerator/titanium_mobile/pull/6306
  22. Kajenthiran Velummaylum 2014-11-26

    Issue is no longer reproducible with following environment. Closing the ticket. Test Environment: Titanium SDK: 3.5.0.v20141121153314 Appc-Studio: 3.4.1 GA Titanium CLI: 3.4.1 GA Alloy : 1.5.1 GA Xcode : 6.1 OS: OSX 10.10.1 Device : iPhone 6plus (iOS 8.1) I reproduced the bug using Release 3.2.2 components and then tried the same steps to test in above (3.5.0) environment. Issue is *not reproducible* any more.

JSON Source