[TIMOB-13027] iOS: TextField focus() event not fired when application loads in landscape mode as iPhone app on iPad
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2013-03-20T16:38:59.000+0000 |
Affected Version/s | Release 3.0.2 |
Fix Version/s | Release 3.1.0, 2013 Sprint 06 API, 2013 Sprint 06 |
Components | iOS |
Labels | module_textfield, qe-testadded |
Reporter | Daniel Sefton |
Assignee | Ingo Muschenetz |
Created | 2013-03-11T20:57:54.000+0000 |
Updated | 2017-03-22T22:10:04.000+0000 |
Description
*Problem description*
When the app loads in landscape mode on iPad (as an iPhone app), the text field focus events are not fired when tapping on the fields. However, once a device rotation occurs, it starts working.
*Test case*
var win = Ti.UI.createWindow({
backgroundColor : '#000'
});
var registerUsername = Titanium.UI.createTextField({
hintText : 'User ID',
height : 40,
left : 10,
top : 80,
width : Ti.Platform.displayCaps.platformWidth - 40,
borderStyle : Titanium.UI.INPUT_BORDERSTYLE_ROUNDED
});
var registerPassword = Titanium.UI.createTextField({
hintText : 'Password',
height : 40,
left : 10,
top : 40,
passwordMask : true,
width : Ti.Platform.displayCaps.platformWidth - 40,
borderStyle : Titanium.UI.INPUT_BORDERSTYLE_ROUNDED
});
win.add(registerUsername);
win.add(registerPassword);
registerUsername.addEventListener('focus', function() {
Ti.API.info("Register Username: Focus Event");
});
registerPassword.addEventListener('focus', function() {
Ti.API.info("Register Password: Focus Event");
});
win.open();
*tiapp.xml changes*
<iphone>
<orientations device="iphone">
<orientation>Ti.UI.LANDSCAPE_LEFT</orientation>
<orientation>Ti.UI.LANDSCAPE_RIGHT</orientation>
</orientations>
<orientations device="ipad">
<orientation>Ti.UI.LANDSCAPE_LEFT</orientation>
<orientation>Ti.UI.LANDSCAPE_RIGHT</orientation>
</orientations>
</iphone>
The problem seem to be avoided if the window is set to fullscreen:
More information: This only happens on iOS 6.0 or later, both on simulator and device, and even hitting the (2x) button dispells the situation. This may be something only Apple can fix.
I wonder if it is the same issue that we saw in TIMOB-12924. A simple js workaround was provided for that issue. Would be worthwhile to investigate if the same workaround works here as well.
As far as I can tell, this is a duplicate of TIMOB-12924. Making the association.
Also, Titanium.UI.iPhone.showStatusBar({animated: false}); indeed does mitigate this. Proposing that, given this is partially Apple's bug and has a workaround, that we push it off until later.
Closing ticket as duplicate and links to the related ticket have been provided above.