Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15008] iOS: iPad Alert dialog does not consider window orientation modes

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-09-03T17:55:22.000+0000
Affected Version/sRelease 3.1.1, Release 3.1.2
Fix Version/sRelease 3.1.3, Release 3.2.0
ComponentsiOS
Labelsmodule_orientation, qe-closed-3.1.3, qe-testadded, supportTeam
ReporterRupesh Sharma
AssigneeSabil Rahim
Created2013-08-30T12:12:05.000+0000
Updated2014-09-08T20:53:50.000+0000

Description

Description

We have modal window and a button. when user clicks on the button alert pops up. The app is supposed to have only portrait orientation which is set in tiApp.xml file. When alert pops up, the device supports orientation change.

Testcase

Step to reproduce: 1.Tap on the button in the main window,which opens modal window. 2.Tap on the button in modal window that brings up alert dialog. 3.Try rotating the device and orientation is supported

//app.js
var win = Ti.UI.createWindow({
backgroundColor : '#fff',
    
orientationModes : [Ti.UI.PORTRAIT] //to be sure
});
 
 
var clickMeBtn = Ti.UI.createButton({
 
title : 'Click to open modal window'
});

var cancelBtn = Ti.UI.createButton({
 
title : 'cancel'
});

var modalWin = Ti.UI.createWindow({
backgroundColor : '#bbb',
    
modal : true,
    
orientationModes : [Ti.UI.PORTRAIT] //to be extra double sure
});

var modalButton = Ti.UI.createButton({
title : 'Click to test Orientation'
});
modalWin.add(modalButton); 
modalWin.setLeftNavButton(cancelBtn);
 
win.add(clickMeBtn);
  
 
clickMeBtn.addEventListener('click',function(_event){
 
 modalWin.open();
 
});

modalButton.addEventListener('click', function(e) {
   var dialog = Ti.UI.createAlertDialog({
    message: 'Rotate device to see the orientaion change',
    ok: 'Okay',
    title: 'File Deleted'
  }).show(); 
//alert('Rotate device to see the orientaion change');
});

cancelBtn.addEventListener('click', function(e){
	modalWin.close();
});
 
win.open();
In tiapp.xml
<iphone>
        <orientations device="iphone">
            <orientation>Ti.UI.PORTRAIT</orientation>
        </orientations>
        <orientations device="ipad">
            <orientation>Ti.UI.PORTRAIT</orientation>
        </orientations>
</iphone>

Comments

  1. Sabil Rahim 2013-09-03

    Tested with 3.1.3 githash=df94e5e Tested on Xcode 5 DP 5 ipad 4 ios7 beta 6. Should have been fixed along with windows refactor.
  2. Olga Romero 2013-09-03

    Tested the above code. The app has only portrait orientation. Environment: Appcelerator Studio, build: 3.1.3.201308302458 Titanium SDK, build: 3.1.3.v20130902103448 KS[3_1_X] https://github.com/appcelerator-developer-relations/KitchenSink/tree/3_1_X CLI: 3.1.2 Alloy: 1.2.1 Devices: iPad 4 iOS7(11A4449d)

JSON Source