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();
Regression? TIMOB-6490
This prevents the shipping of an app.
Bumped priority.
Pull pending against master https://github.com/appcelerator/titanium_mobile/pull/5184
Backport to 3_2_X https://github.com/appcelerator/titanium_mobile/pull/5188
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)
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
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
Follows a video showing the bug still persists: http://youtu.be/4HL2S0ToCGQ
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.
PR: https://github.com/appcelerator/titanium_mobile/pull/5956
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)
[~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?
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
[~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.
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.
[~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.
yes happened with 3.3.0.GA, still dont have tester details.
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.1Steps 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 visibleActual behavior
Toolbar disappears and keyboard remains visibleCannot 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.1PR merged
PR's mereged master - https://github.com/appcelerator/titanium_mobile/pull/5956 3_4_X - https://github.com/appcelerator/titanium_mobile/pull/6306
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.