[TIMOB-10972] iOS 6: Window orientation modes are neglected for second level child window
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-07-23T11:51:58.000+0000 |
Affected Version/s | Release 2.1.3 |
Fix Version/s | Release 2.1.3, Release 3.0.0, Sprint 2012-19 API, 2012 Sprint 19 |
Components | iOS |
Labels | api, module_window, qe-ios090112, qe-ios6, qe-testadded |
Reporter | Shyam Bhadauria |
Assignee | Vishal Duggal |
Created | 2012-09-19T03:04:34.000+0000 |
Updated | 2013-07-23T11:51:58.000+0000 |
Description
This is not a regression. It occurs on 2.1.2 also on iOS 6 device/simulator. It works fine on iOS 5.
If you have 3 windows - one parent,one child and third one grandchild, each with their set of orientationmodes,then orientationmodes of grandchild window are over ruled by the child window.
Steps to reproduce:
1. Use the code below-
var _window = Ti.UI.createWindow({
orientationModes : [Titanium.UI.LANDSCAPE_LEFT, Titanium.UI.LANDSCAPE_RIGHT],
});
var aBtn = Ti.UI.createButton({
title:'open',
height: 100,
width: 100
});
aBtn.addEventListener('click', function(){
var toplevel = Ti.UI.createWindow({
orientationModes : [Ti.UI.PORTRAIT, Ti.UI.UPSIDE_PORTRAIT],
backgroundColor : 'blue'
});
var btn = Ti.UI.createButton({
title:'close',
height: 100,
width: 100
});
btn.addEventListener('click', function() {
toplevel.close();
});
toplevel.add(btn);
var win = Ti.UI.createWindow({
orientationModes : [Titanium.UI.LANDSCAPE_LEFT, Titanium.UI.LANDSCAPE_RIGHT],
backgroundColor : 'green'
});
var b = Ti.UI.createButton({
title : 'open',
width : 100,
height : 50,
bottom:0
});
b.addEventListener('click', function() {
win.open({
modal : true
});
});
var b3 = Ti.UI.createButton({
title : 'close',
width : 100,
height : 50,
bottom : 20
});
b3.addEventListener('click', function() {
win.close();
});
toplevel.add(b);
win.add(b3);
toplevel.open();
});
_window.add(aBtn);
_window.open();
2. Click 'open' button
3. Click 'open' button again
Expected result:
1. A black window with 'open' button should get displayed in landscape mode.
2. A blue window with 'open' and 'close' button should get displayed in portrait mode.
3. A green window with 'close' button should get displayed in landscape mode.
Actual result:
1. A black window with 'open' button gets displayed in landscape mode.
2. A blue window with 'open' and 'close' button gets displayed in portrait mode.
3. A green window with 'close' button gets displayed in portrait mode.
Pull merged, checked to see if this was fixed as well.
Tested and verified on: OS: Mac OS X Lion 10.7.4 Titanium Studio, build: 2.1.2.201208301612 Titanium SDK, build: 2.1.3.v20120921141611 Device: iPhone 4S (6.0.GM) A green window with 'close' button gets displayed in landscape mode.
Verified the fix on: MAC OSX 10.8.1 Titanium studio : 2.1.2.201208301612 SDK version : 3.0.0.v20120921144915 xcode 4.5 built with iOS6 SDK on Ipad 3 running iOS6 & on Iphone simulator.
Reopening to update labels
Tested with: SDK:3.1.2.v20130718094558 Appcelerator Studio: 3.1.2.201307121651 OS: OSX 10.7.5 Device:iPadmini(ios6) Xcode: 4.6