Problem Description
If you add a textfield to a view that has an animation, the textfield won't show the keyboard.
Steps to reproduce
1. Create a new mobile project
2. Copy-Paste the test case to app.js
3. Run it
4. You will see that if you click on the textfield, the keyboard won't pop-up.
Test Case
var self = Titanium.UI.createWindow({
backgroundColor:'#fff',
});
var textField = Titanium.UI.createTextField({
top:300,
height:40,
borderColor:'red',
width:200,
});
var up = Titanium.UI.createAnimation({
top:-150,
bottom:150,
});
var down = Titanium.UI.createAnimation({
top:0,
bottom:0,
});
textField.addEventListener('focus', function(e){
// self.top = -150;
// self.bottom = 150;
self.animate(up);
Titanium.API.info('test');
});
textField.addEventListener('blur',function(e){
// self.top = 0;
// self.bottom = 0;
self.animate(down);
Titanium.API.info('test2');
});
self.add(textField);
self.open();
Issue reproduces with 3.1.3 and 3.4.0 GA Titanium Command-Line Interface, CLI version 3.3.0, Titanium SDK version 3.4.0.GA iOS SDK: 7.0 iOS iPhone Simulator: 7.0
Yep, this issue becomes clearer when you want to provide feed back to the user entering some input in a textfield with this module https://github.com/caffeinalab/ti.notifications/issues/22 which uses animations. As the animation completes, the FirstResponder is taken away from the textfield and added to the view that finished animation.
I am able to reproduce this issue with the following environment; iPhone 7 (10.2) Studio 4.9.0.201705302345 Ti SDK 6.1.1.v20170623141152 Appc NPM 4.2.9 Appc CLI 6.2.1 Ti CLI 5.0.13 Alloy 1.9.11 Arrow 2.0.0 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131