[TIMOB-12988] iOS: Calling focus() on the next text field causes the parent scroll view to bounce on iPad 1 only
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-04-19T22:07:29.000+0000 |
Affected Version/s | Release 3.0.2 |
Fix Version/s | 2013 Sprint 08 API, 2013 Sprint 08, Release 3.1.1, Release 3.2.0 |
Components | iOS |
Labels | SupportTeam, qe-closed-3.1.1 |
Reporter | Daniel Sefton |
Assignee | Vishal Duggal |
Created | 2013-03-07T00:19:36.000+0000 |
Updated | 2013-05-15T17:39:47.000+0000 |
Description
*Problem description*
When calling focus() on the next text field in a vertical layout, the parent scroll view bounces instead of smoothly transitioning to the next field. It works fine on other devices e.g. iPad 3 and iOS simulator.
*Test case*
var win1 = Titanium.UI.createWindow({
title : 'Tab 1',
backgroundColor : '#fff'
});
var scrollContainer = Ti.UI.createScrollView({
height : Ti.UI.SIZE,
layout : "vertical",
left : 10,
right : 10,
bottom : 0
});
var formContainer = Ti.UI.createView({
backgroundColor : "#fff",
height : Ti.UI.SIZE,
width : Ti.UI.FILL,
layout : "vertical",
top : 7,
left : 0,
right : 0,
bottom : 7,
borderWidth : 1,
borderColor : '#000'
});
scrollContainer.add(formContainer);
var getTextFieldRow = function(arg) {
var nameField = Titanium.UI.createTextField({
id : arg.id,
hintText : "ID: " + arg.id,
color : '#444',
font : {
fontSize : 12,
fontFamily : 'Helvetica Neue'
},
height : 35,
width : 262,
paddingLeft : 6,
suppressReturn : false,
returnKeyType : Titanium.UI.RETURNKEY_NEXT,
borderStyle : Ti.UI.INPUT_BORDERSTYLE_ROUNDED
});
return nameField;
}
var textFields = [];
for (var i = 0; i < 30; i++) {
textFields.push(getTextFieldRow({
id : i
}));
}
for (var i = 0; i < textFields.length; i++) {
textFields[i].addEventListener('return', function(e) {
if (e.source.id + 1 < textFields.length) {
textFields[e.source.id + 1].focus();
}
});
formContainer.add(textFields[i]);
}
win1.add(scrollContainer);
win1.open();
Aha. I get it, I get it. iPad 1 is the only iPad that's single core. It's a timing issue because of that.
https://github.com/appcelerator/titanium_mobile/pull/4007
Pull pending https://github.com/appcelerator/titanium_mobile/pull/4178 Huge regression path. Apologies.
FR
Backport to 3_1_X https://github.com/appcelerator/titanium_mobile/pull/4202
Verified fix with: Appcelerator Studio, build: 3.1.1.201305142215 SDK, build: 3.1.1.v20130514180723 Device: iPad 1 iOS 5.1.1 When calling focus() on the next text field in a vertical layout, the parent scroll view is smoothly transitioning to the next field